Bug 1044595 - fix default/active button text on OS X 10.10, r=mstange,jaws

--HG--
extra : rebase_source : c558491822fc158d44a127cfd5014bd5338d05f1
This commit is contained in:
Gijs Kruitbosch 2014-09-12 00:31:15 +01:00
Родитель 713c41b609
Коммит 55e3cc3889
7 изменённых файлов: 35 добавлений и 0 удалений

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

@ -84,8 +84,10 @@ CSS_KEY(-moz-isolate, _moz_isolate)
CSS_KEY(-moz-isolate-override, _moz_isolate_override)
CSS_KEY(-moz-left, _moz_left)
CSS_KEY(-moz-list, _moz_list)
CSS_KEY(-moz-mac-buttonactivetext, _moz_mac_buttonactivetext)
CSS_KEY(-moz-mac-chrome-active, _moz_mac_chrome_active)
CSS_KEY(-moz-mac-chrome-inactive, _moz_mac_chrome_inactive)
CSS_KEY(-moz-mac-defaultbuttontext, _moz_mac_defaultbuttontext)
CSS_KEY(-moz-mac-focusring, _moz_mac_focusring)
CSS_KEY(-moz-mac-fullscreen-button, _moz_mac_fullscreen_button)
CSS_KEY(-moz-mac-menuselect, _moz_mac_menuselect)

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

@ -948,8 +948,10 @@ const KTableValue nsCSSProps::kColorKTable[] = {
eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
eCSSKeyword__moz_html_cellhighlight, LookAndFeel::eColorID__moz_html_cellhighlight,
eCSSKeyword__moz_html_cellhighlighttext, LookAndFeel::eColorID__moz_html_cellhighlighttext,
eCSSKeyword__moz_mac_buttonactivetext, LookAndFeel::eColorID__moz_mac_buttonactivetext,
eCSSKeyword__moz_mac_chrome_active, LookAndFeel::eColorID__moz_mac_chrome_active,
eCSSKeyword__moz_mac_chrome_inactive, LookAndFeel::eColorID__moz_mac_chrome_inactive,
eCSSKeyword__moz_mac_defaultbuttontext, LookAndFeel::eColorID__moz_mac_defaultbuttontext,
eCSSKeyword__moz_mac_focusring, LookAndFeel::eColorID__moz_mac_focusring,
eCSSKeyword__moz_mac_menuselect, LookAndFeel::eColorID__moz_mac_menuselect,
eCSSKeyword__moz_mac_menushadow, LookAndFeel::eColorID__moz_mac_menushadow,

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

@ -14,6 +14,22 @@ button {
text-shadow: none;
}
button:hover:active {
color: -moz-mac-buttonactivetext;
}
/* When the window isn't focused, the default button background isn't drawn,
* so don't change the text color then: */
button[default="true"]:not(:-moz-window-inactive) {
color: -moz-mac-defaultbuttontext;
}
/* Likewise, when active (mousedown) but not hovering, the default button
* background isn't drawn, override the previous selector for that case: */
button[default="true"]:not(:hover):active {
color: ButtonText;
}
.button-text {
margin: 1px 0 !important;
-moz-margin-start: 3px !important;

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

@ -126,10 +126,14 @@ public:
// colors needed by the Mac OS X theme
// foreground color of :hover:active buttons
eColorID__moz_mac_buttonactivetext,
// background color of chrome toolbars in active windows
eColorID__moz_mac_chrome_active,
// background color of chrome toolbars in inactive windows
eColorID__moz_mac_chrome_inactive,
// foreground color of default buttons
eColorID__moz_mac_defaultbuttontext,
//ring around text fields and lists
eColorID__moz_mac_focusring,
//colour used when mouse is over a menu item

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

@ -137,6 +137,13 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
// Thanks to mpt26@student.canterbury.ac.nz for the hardcoded values that form the defaults
// if querying the Appearance Manager fails ;)
//
case eColorID__moz_mac_buttonactivetext:
case eColorID__moz_mac_defaultbuttontext:
if (nsCocoaFeatures::OnYosemiteOrLater()) {
aColor = NS_RGB(0xFF,0xFF,0xFF);
break;
}
// Otherwise fall through and return the regular button text:
case eColorID_buttontext:
case eColorID__moz_buttonhovertext:

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

@ -66,8 +66,10 @@ var colors = {
"-moz-hyperlinktext": ["rgb(0, 0, 238)"],
"-moz-html-cellhighlight": ["rgb(212, 212, 212)"],
"-moz-html-cellhighlighttext": ["rgb(0, 0, 0)"],
"-moz-mac-buttonactivetext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
"-moz-mac-chrome-active": ["rgb(150, 150, 150)", "rgb(167, 167, 167)", "rgb(178, 178, 178)"],
"-moz-mac-chrome-inactive": ["rgb(202, 202, 202)", "rgb(216, 216, 216)", "rgb(225, 225, 225)"],
"-moz-mac-defaultbuttontext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
//"-moz-mac-focusring": ["rgb(83, 144, 210)", "rgb(95, 112, 130)", "rgb(63, 152, 221)", "rgb(108, 126, 141)"],
"-moz-mac-menuselect": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
"-moz-mac-menushadow": ["rgb(163, 163, 163)"],

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

@ -215,8 +215,10 @@ const char nsXPLookAndFeel::sColorPrefs[][38] =
"ui.-moz_menubarhovertext",
"ui.-moz_eventreerow",
"ui.-moz_oddtreerow",
"ui.-moz-mac-buttonactivetext",
"ui.-moz_mac_chrome_active",
"ui.-moz_mac_chrome_inactive",
"ui.-moz-mac-defaultbuttontext",
"ui.-moz-mac-focusring",
"ui.-moz-mac-menuselect",
"ui.-moz-mac-menushadow",