diff options
author | Moonchild <moonchild@palemoon.org> | 2021-06-14 11:52:16 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-06-14 11:52:16 +0000 |
commit | a970411caf9b1951708efb4987733c6a4581454b (patch) | |
tree | f6d02670ceb4913e878aadfcb7b9ba9e0600c45f /widget | |
parent | e8be661944c730cb3b702cd7f7d97e0860eb9132 (diff) | |
download | uxp-a970411caf9b1951708efb4987733c6a4581454b.tar.gz |
Issue #1782: Remove Luna, Royale and Zune support from the platform.
These are obsolete system themes; the platform will fall back to generic/unknown
theme support instead.
Diffstat (limited to 'widget')
-rw-r--r-- | widget/LookAndFeel.h | 5 | ||||
-rw-r--r-- | widget/windows/nsNativeThemeWin.cpp | 1 | ||||
-rw-r--r-- | widget/windows/nsUXThemeData.cpp | 66 | ||||
-rw-r--r-- | widget/windows/nsUXThemeData.h | 10 |
4 files changed, 13 insertions, 69 deletions
diff --git a/widget/LookAndFeel.h b/widget/LookAndFeel.h index 60ebc2782c..226aa0d61e 100644 --- a/widget/LookAndFeel.h +++ b/widget/LookAndFeel.h @@ -438,11 +438,6 @@ public: eWindowsTheme_Generic = 0, // unrecognized theme eWindowsTheme_Classic, eWindowsTheme_Aero, - eWindowsTheme_LunaBlue, - eWindowsTheme_LunaOlive, - eWindowsTheme_LunaSilver, - eWindowsTheme_Royale, - eWindowsTheme_Zune, eWindowsTheme_AeroLite }; diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index 0947019caa..40bc3d7c28 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -1101,7 +1101,6 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType, return NS_OK; } case NS_THEME_TREEHEADERSORTARROW: { - // XXX Probably will never work due to a bug in the Luna theme. aPart = 4; aState = 1; return NS_OK; diff --git a/widget/windows/nsUXThemeData.cpp b/widget/windows/nsUXThemeData.cpp index ce27775851..e13f1234da 100644 --- a/widget/windows/nsUXThemeData.cpp +++ b/widget/windows/nsUXThemeData.cpp @@ -240,9 +240,8 @@ nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) } // visual style (aero glass, aero basic) -// theme (aero, luna, zune) -// theme color (silver, olive, blue) -// system colors +// theme (aero, aero-lite) +// system colors struct THEMELIST { LPCWSTR name; @@ -251,16 +250,7 @@ struct THEMELIST { const THEMELIST knownThemes[] = { { L"aero.msstyles", WINTHEME_AERO }, - { L"aerolite.msstyles", WINTHEME_AERO_LITE }, - { L"luna.msstyles", WINTHEME_LUNA }, - { L"zune.msstyles", WINTHEME_ZUNE }, - { L"royale.msstyles", WINTHEME_ROYALE } -}; - -const THEMELIST knownColors[] = { - { L"normalcolor", WINTHEMECOLOR_NORMAL }, - { L"homestead", WINTHEMECOLOR_HOMESTEAD }, - { L"metallic", WINTHEMECOLOR_METALLIC } + { L"aerolite.msstyles", WINTHEME_AERO_LITE } }; LookAndFeel::WindowsTheme @@ -347,57 +337,25 @@ nsUXThemeData::UpdateNativeThemeInfo() if (theme == WINTHEME_UNRECOGNIZED) return; - // We're using the default theme if we're using any of Aero, Aero Lite, or - // luna. However, on Win8, GetCurrentThemeName (see above) returns + // We're using the default theme if we're using Aero or Aero Lite + // However, on Win8 or later, GetCurrentThemeName (see above) returns // AeroLite.msstyles for the 4 builtin highcontrast themes as well. Those // themes "don't count" as default themes, so we specifically check for high // contrast mode in that situation. if (!(IsWin8OrLater() && sIsHighContrastOn) && - (theme == WINTHEME_AERO || theme == WINTHEME_AERO_LITE || theme == WINTHEME_LUNA)) { + (theme == WINTHEME_AERO || theme == WINTHEME_AERO_LITE)) { sIsDefaultWindowsTheme = true; } - if (theme != WINTHEME_LUNA) { - switch(theme) { - case WINTHEME_AERO: - sThemeId = LookAndFeel::eWindowsTheme_Aero; - return; - case WINTHEME_AERO_LITE: - sThemeId = LookAndFeel::eWindowsTheme_AeroLite; - return; - case WINTHEME_ZUNE: - sThemeId = LookAndFeel::eWindowsTheme_Zune; - return; - case WINTHEME_ROYALE: - sThemeId = LookAndFeel::eWindowsTheme_Royale; - return; - default: - NS_WARNING("unhandled theme type."); - return; - } - } - - // calculate the luna color scheme - WindowsThemeColor color = WINTHEMECOLOR_UNRECOGNIZED; - for (size_t i = 0; i < ArrayLength(knownColors); ++i) { - if (!lstrcmpiW(themeColor, knownColors[i].name)) { - color = (WindowsThemeColor)knownColors[i].type; - break; - } - } - - switch(color) { - case WINTHEMECOLOR_NORMAL: - sThemeId = LookAndFeel::eWindowsTheme_LunaBlue; - return; - case WINTHEMECOLOR_HOMESTEAD: - sThemeId = LookAndFeel::eWindowsTheme_LunaOlive; + switch(theme) { + case WINTHEME_AERO: + sThemeId = LookAndFeel::eWindowsTheme_Aero; return; - case WINTHEMECOLOR_METALLIC: - sThemeId = LookAndFeel::eWindowsTheme_LunaSilver; + case WINTHEME_AERO_LITE: + sThemeId = LookAndFeel::eWindowsTheme_AeroLite; return; default: - NS_WARNING("unhandled theme color."); + NS_WARNING("unhandled theme type."); return; } } diff --git a/widget/windows/nsUXThemeData.h b/widget/windows/nsUXThemeData.h index 2688ec6592..84894cd4eb 100644 --- a/widget/windows/nsUXThemeData.h +++ b/widget/windows/nsUXThemeData.h @@ -61,17 +61,9 @@ enum WindowsTheme { WINTHEME_UNRECOGNIZED = 0, WINTHEME_CLASSIC = 1, // no theme WINTHEME_AERO = 2, - WINTHEME_LUNA = 3, - WINTHEME_ROYALE = 4, - WINTHEME_ZUNE = 5, + // 3, 4 and 5 were used for XP themes WINTHEME_AERO_LITE = 6 }; -enum WindowsThemeColor { - WINTHEMECOLOR_UNRECOGNIZED = 0, - WINTHEMECOLOR_NORMAL = 1, - WINTHEMECOLOR_HOMESTEAD = 2, - WINTHEMECOLOR_METALLIC = 3 -}; #define CMDBUTTONIDX_MINIMIZE 0 #define CMDBUTTONIDX_RESTORE 1 |