Bug 1698291 - Make -moz-accent-color reflect the windows accent color. r=dao

And remove the windows-specific versions of this color.

Also fix the hard-coded defaults by the colors I get in the default windows
theme.

Differential Revision: https://phabricator.services.mozilla.com/D108325
This commit is contained in:
Emilio Cobos Alvarez 2021-03-15 20:59:42 +00:00
Родитель deedd29802
Коммит 52c38f586e
4 изменённых файлов: 8 добавлений и 18 удалений

Просмотреть файл

@ -53,7 +53,7 @@
border-top: 1px solid rgba(0,0,0,.7);
}
:root[sizemode=normal][tabsintitlebar][always-use-accent-color-for-window-border]:not(:-moz-window-inactive) {
border-top-color: -moz-win-accentcolor;
border-top-color: -moz-accent-color;
}
:root[tabsintitlebar]:not(:-moz-lwtheme) {
background-color: hsl(235,33%,19%);
@ -63,12 +63,12 @@
@media (-moz-windows-accent-color-in-titlebar) {
:root[sizemode=normal][tabsintitlebar] {
border-top: 1px solid -moz-win-accentcolor;
border-top: 1px solid -moz-accent-color;
}
:root[tabsintitlebar]:not(:-moz-window-inactive, :-moz-lwtheme),
:root[tabsintitlebar]:not(:-moz-window-inactive)[lwt-default-theme-in-dark-mode] {
background-color: -moz-win-accentcolor;
color: -moz-win-accentcolortext;
background-color: -moz-accent-color;
color: -moz-accent-color-foreground;
}
:root[tabsintitlebar][lwt-default-theme-in-dark-mode] #titlebar {
--lwt-toolbarbutton-icon-fill: currentColor;

Просмотреть файл

@ -337,10 +337,6 @@ pub enum SystemColor {
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozAccentColorForeground,
/// Accent color for title bar.
MozWinAccentcolor,
/// Color from drawing text over the accent color.
MozWinAccentcolortext,
/// Media rebar text.
MozWinMediatext,
/// Communications rebar text.

Просмотреть файл

@ -229,8 +229,6 @@ const char nsXPLookAndFeel::sColorPrefs[][41] = {
"ui.-moz-mac-tooltip",
"ui.-moz-accent-color",
"ui.-moz-accent-color-foreground",
"ui.-moz-win-accentcolor",
"ui.-moz-win-accentcolortext",
"ui.-moz-win-mediatext",
"ui.-moz-win-communicationstext",
"ui.-moz-nativehyperlinktext",
@ -660,8 +658,6 @@ nscolor nsXPLookAndFeel::GetStandinForNativeColor(ColorID aID) {
COLOR(MozMacActiveSourceListSelection, 0x0a, 0x64, 0xdc)
COLOR(MozMacTooltip, 0xf7, 0xf7, 0xf7)
// Seems to be the default color (hardcoded because of bug 1065998)
COLOR(MozWinAccentcolor, 0x9E, 0x9E, 0x9E)
COLOR(MozWinAccentcolortext, 0x00, 0x00, 0x00)
COLOR(MozWinMediatext, 0xFF, 0xFF, 0xFF)
COLOR(MozWinCommunicationstext, 0xFF, 0xFF, 0xFF)
COLOR(MozNativehyperlinktext, 0x00, 0x66, 0xCC)

Просмотреть файл

@ -228,7 +228,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
idx = COLOR_GRAYTEXT;
break;
case ColorID::Highlight:
case ColorID::MozAccentColor:
case ColorID::MozHtmlCellhighlight:
case ColorID::MozMenuhover:
idx = COLOR_HIGHLIGHT;
@ -247,7 +246,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
}
// Fall through
case ColorID::Highlighttext:
case ColorID::MozAccentColorForeground:
case ColorID::MozHtmlCellhighlighttext:
idx = COLOR_HIGHLIGHTTEXT;
break;
@ -314,19 +312,19 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) {
case ColorID::MozCellhighlight:
idx = COLOR_3DFACE;
break;
case ColorID::MozWinAccentcolor:
case ColorID::MozAccentColor:
if (mHasColorAccent) {
aColor = mColorAccent;
} else {
// Seems to be the default color (hardcoded because of bug 1065998)
aColor = NS_RGB(158, 158, 158);
aColor = NS_RGB(0, 120, 215);
}
return NS_OK;
case ColorID::MozWinAccentcolortext:
case ColorID::MozAccentColorForeground:
if (mHasColorAccentText) {
aColor = mColorAccentText;
} else {
aColor = NS_RGB(0, 0, 0);
aColor = NS_RGB(255, 255, 255);
}
return NS_OK;
case ColorID::MozWinMediatext: