mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 23:37:31 +09:00
parent
41ee5136f4
commit
8aa201ff06
6 changed files with 37 additions and 0 deletions
|
|
@ -2231,6 +2231,7 @@ GK_ATOM(scrollbar_end_forward, "scrollbar-end-forward")
|
||||||
GK_ATOM(scrollbar_thumb_proportional, "scrollbar-thumb-proportional")
|
GK_ATOM(scrollbar_thumb_proportional, "scrollbar-thumb-proportional")
|
||||||
GK_ATOM(overlay_scrollbars, "overlay-scrollbars")
|
GK_ATOM(overlay_scrollbars, "overlay-scrollbars")
|
||||||
GK_ATOM(windows_accent_color_applies, "windows-accent-color-applies")
|
GK_ATOM(windows_accent_color_applies, "windows-accent-color-applies")
|
||||||
|
GK_ATOM(windows_accent_color_is_dark, "windows-accent-color-is-dark")
|
||||||
GK_ATOM(windows_default_theme, "windows-default-theme")
|
GK_ATOM(windows_default_theme, "windows-default-theme")
|
||||||
GK_ATOM(mac_graphite_theme, "mac-graphite-theme")
|
GK_ATOM(mac_graphite_theme, "mac-graphite-theme")
|
||||||
GK_ATOM(mac_yosemite_theme, "mac-yosemite-theme")
|
GK_ATOM(mac_yosemite_theme, "mac-yosemite-theme")
|
||||||
|
|
@ -2261,6 +2262,7 @@ GK_ATOM(_moz_scrollbar_end_forward, "-moz-scrollbar-end-forward")
|
||||||
GK_ATOM(_moz_scrollbar_thumb_proportional, "-moz-scrollbar-thumb-proportional")
|
GK_ATOM(_moz_scrollbar_thumb_proportional, "-moz-scrollbar-thumb-proportional")
|
||||||
GK_ATOM(_moz_overlay_scrollbars, "-moz-overlay-scrollbars")
|
GK_ATOM(_moz_overlay_scrollbars, "-moz-overlay-scrollbars")
|
||||||
GK_ATOM(_moz_windows_accent_color_applies, "-moz-windows-accent-color-applies")
|
GK_ATOM(_moz_windows_accent_color_applies, "-moz-windows-accent-color-applies")
|
||||||
|
GK_ATOM(_moz_windows_accent_color_is_dark, "-moz-windows-accent-color-is-dark")
|
||||||
GK_ATOM(_moz_windows_default_theme, "-moz-windows-default-theme")
|
GK_ATOM(_moz_windows_default_theme, "-moz-windows-default-theme")
|
||||||
GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme")
|
GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme")
|
||||||
GK_ATOM(_moz_mac_yosemite_theme, "-moz-mac-yosemite-theme")
|
GK_ATOM(_moz_mac_yosemite_theme, "-moz-mac-yosemite-theme")
|
||||||
|
|
|
||||||
|
|
@ -1132,6 +1132,11 @@ InitSystemMetrics()
|
||||||
sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_applies);
|
sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_applies);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsAccentColorIsDark, &metricResult);
|
||||||
|
if (NS_SUCCEEDED(rv) && metricResult) {
|
||||||
|
sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_is_dark);
|
||||||
|
}
|
||||||
|
|
||||||
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_DWMCompositor, &metricResult);
|
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_DWMCompositor, &metricResult);
|
||||||
if (NS_SUCCEEDED(rv) && metricResult) {
|
if (NS_SUCCEEDED(rv) && metricResult) {
|
||||||
sSystemMetrics->AppendElement(nsGkAtoms::windows_compositor);
|
sSystemMetrics->AppendElement(nsGkAtoms::windows_compositor);
|
||||||
|
|
|
||||||
|
|
@ -723,6 +723,14 @@ nsMediaFeatures::features[] = {
|
||||||
{ &nsGkAtoms::windows_accent_color_applies },
|
{ &nsGkAtoms::windows_accent_color_applies },
|
||||||
GetSystemMetric
|
GetSystemMetric
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
&nsGkAtoms::_moz_windows_accent_color_is_dark,
|
||||||
|
nsMediaFeature::eMinMaxNotAllowed,
|
||||||
|
nsMediaFeature::eBoolInteger,
|
||||||
|
nsMediaFeature::eNoRequirements,
|
||||||
|
{ &nsGkAtoms::windows_accent_color_is_dark },
|
||||||
|
GetSystemMetric
|
||||||
|
},
|
||||||
{
|
{
|
||||||
&nsGkAtoms::_moz_windows_compositor,
|
&nsGkAtoms::_moz_windows_compositor,
|
||||||
nsMediaFeature::eMinMaxNotAllowed,
|
nsMediaFeature::eMinMaxNotAllowed,
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,15 @@ public:
|
||||||
*/
|
*/
|
||||||
eIntID_WindowsAccentColorApplies,
|
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
|
* A Boolean value to determine whether the Windows default theme is
|
||||||
* being used.
|
* being used.
|
||||||
|
|
|
||||||
|
|
@ -442,6 +442,14 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||||
aResult = NS_SUCCEEDED(GetAccentColor(unused)) ? 1 : 0;
|
aResult = NS_SUCCEEDED(GetAccentColor(unused)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case eIntID_WindowsAccentColorIsDark:
|
||||||
|
{
|
||||||
|
nscolor accentColor;
|
||||||
|
if (NS_SUCCEEDED(GetAccentColor(accentColor))) {
|
||||||
|
aResult = AccentColorIsDark(accentColor) ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case eIntID_WindowsGlass:
|
case eIntID_WindowsGlass:
|
||||||
// Aero Glass is only available prior to Windows 8 when DWM is used.
|
// Aero Glass is only available prior to Windows 8 when DWM is used.
|
||||||
aResult = (nsUXThemeData::CheckForCompositor() && !IsWin8OrLater());
|
aResult = (nsUXThemeData::CheckForCompositor() && !IsWin8OrLater());
|
||||||
|
|
|
||||||
|
|
@ -7138,6 +7138,11 @@ nsWindow::OnSysColorChanged()
|
||||||
// so all presentations get notified properly.
|
// so all presentations get notified properly.
|
||||||
// See nsWindow::GlobalMsgWindowProc.
|
// See nsWindow::GlobalMsgWindowProc.
|
||||||
NotifySysColorChanged();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue