diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2017-07-19 16:34:50 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-04 20:41:16 +0100 |
commit | 0f285318cdf3336aabda0cfa6bc306b2274f14e8 (patch) | |
tree | 3ff47def87ee9c18227c6d0b79428f3fc4498d63 /widget | |
parent | 3019e0ff28bfd2d2a65b59501e582bb26356c6d7 (diff) | |
download | uxp-0f285318cdf3336aabda0cfa6bc306b2274f14e8.tar.gz |
Add -moz-windows-accent-color-is-dark
#31 point 4
Diffstat (limited to 'widget')
-rw-r--r-- | widget/LookAndFeel.h | 9 | ||||
-rw-r--r-- | widget/windows/nsLookAndFeel.cpp | 8 | ||||
-rw-r--r-- | widget/windows/nsWindow.cpp | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/widget/LookAndFeel.h b/widget/LookAndFeel.h index 8d510f69fe..e2502c559a 100644 --- a/widget/LookAndFeel.h +++ b/widget/LookAndFeel.h @@ -250,6 +250,15 @@ public: * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric. */ eIntID_WindowsAccentColorApplies, + + /* + * A Boolean value to determine whether the Windows accent color + * is considered dark and should get bright text/controls. + * + * The value of this metric is not used on other platforms. These platforms + * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric. + */ + eIntID_WindowsAccentColorIsDark, /* * A Boolean value to determine whether the Windows default theme is diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp index 5c0358bd94..e649802b18 100644 --- a/widget/windows/nsLookAndFeel.cpp +++ b/widget/windows/nsLookAndFeel.cpp @@ -442,6 +442,14 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult) aResult = NS_SUCCEEDED(GetAccentColor(unused)) ? 1 : 0; } break; + case eIntID_WindowsAccentColorIsDark: + { + nscolor accentColor; + if (NS_SUCCEEDED(GetAccentColor(accentColor))) { + aResult = AccentColorIsDark(accentColor) ? 1 : 0; + } + } + break; case eIntID_WindowsGlass: // Aero Glass is only available prior to Windows 8 when DWM is used. aResult = (nsUXThemeData::CheckForCompositor() && !IsWin8OrLater()); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index dd4f359f73..85321a189d 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -7138,6 +7138,11 @@ nsWindow::OnSysColorChanged() // so all presentations get notified properly. // See nsWindow::GlobalMsgWindowProc. NotifySysColorChanged(); + // On Windows 10 only, we trigger a theme change to pick up changed media + // queries that are needed for accent color changes. + if (IsWin10OrLater()) { + NotifyThemeChanged(); + } } } |