Bug 827075 - Implement the -moz-menubar color and make it return the correct background color on gtk; r=roc

This commit is contained in:
Ehsan Akhgari 2013-01-05 23:07:27 -05:00
parent 32a7997d2a
commit ac66f2835b
12 changed files with 17 additions and 0 deletions

View File

@ -117,6 +117,7 @@ CSS_KEY(-moz-malayalam, _moz_malayalam)
CSS_KEY(-moz-max-content, _moz_max_content)
CSS_KEY(-moz-menuhover, _moz_menuhover)
CSS_KEY(-moz-menuhovertext, _moz_menuhovertext)
CSS_KEY(-moz-menubar, _moz_menubar)
CSS_KEY(-moz-menubartext, _moz_menubartext)
CSS_KEY(-moz-menubarhovertext, _moz_menubarhovertext)
CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)

View File

@ -854,6 +854,7 @@ const int32_t nsCSSProps::kColorKTable[] = {
eCSSKeyword__moz_mac_secondaryhighlight, LookAndFeel::eColorID__moz_mac_secondaryhighlight,
eCSSKeyword__moz_menuhover, LookAndFeel::eColorID__moz_menuhover,
eCSSKeyword__moz_menuhovertext, LookAndFeel::eColorID__moz_menuhovertext,
eCSSKeyword__moz_menubar, LookAndFeel::eColorID__moz_menubar,
eCSSKeyword__moz_menubartext, LookAndFeel::eColorID__moz_menubartext,
eCSSKeyword__moz_menubarhovertext, LookAndFeel::eColorID__moz_menubarhovertext,
eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow,

View File

@ -114,6 +114,8 @@ public:
eColorID__moz_menuhover,
// used to menu item text, when mouse is over
eColorID__moz_menuhovertext,
// used to menu bar background
eColorID__moz_menubar,
// used to menu bar item text
eColorID__moz_menubartext,
// used to menu bar item text, when mouse is over

View File

@ -217,6 +217,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
aColor = mSystemColors.colorForeground;
break;
case eColorID_menu:
case eColorID__moz_menubar:
// menu background
aColor = mSystemColors.colorBackground;
break;

View File

@ -189,6 +189,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
aColor = NS_RGB(0xDA,0xDA,0xDA);
break;
case eColorID_menu:
case eColorID__moz_menubar:
aColor = GetColorFromNSColor([NSColor alternateSelectedControlTextColor]);
break;
case eColorID_infobackground:

View File

@ -174,6 +174,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
aColor = TEXT_NORMAL_COLOR;
break;
case eColorID_menu:
case eColorID__moz_menubar:
// menu background
aColor = BG_NORMAL_COLOR;
break;

View File

@ -37,6 +37,7 @@ using mozilla::LookAndFeel;
nscolor nsLookAndFeel::sInfoText = 0;
nscolor nsLookAndFeel::sInfoBackground = 0;
nscolor nsLookAndFeel::sMenuBar = 0;
nscolor nsLookAndFeel::sMenuBarText = 0;
nscolor nsLookAndFeel::sMenuBarHoverText = 0;
nscolor nsLookAndFeel::sMenuText = 0;
@ -311,6 +312,9 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
case eColorID__moz_combobox:
aColor = sComboBoxBackground;
break;
case eColorID__moz_menubar:
aColor = sMenuBar;
break;
case eColorID__moz_menubartext:
aColor = sMenuBarText;
break;
@ -885,6 +889,7 @@ nsLookAndFeel::InitLookAndFeel()
style = gtk_widget_get_style(menuBar);
if (style) {
sMenuBar = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]);
sMenuBarText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]);
sMenuBarHoverText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_SELECTED]);
}

View File

@ -53,6 +53,7 @@ protected:
static nscolor sInfoBackground;
static nscolor sInfoText;
static nscolor sMenuBackground;
static nscolor sMenuBar;
static nscolor sMenuBarText;
static nscolor sMenuBarHoverText;
static nscolor sMenuText;

View File

@ -151,6 +151,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
idx = SYSCLR_WINDOWTEXT;
break;
case eColorID_menu:
case eColorID__moz_menubar:
idx = SYSCLR_MENU;
break;
case eColorID_menutext:

View File

@ -182,6 +182,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
break;
case eColorID_menu:
case eColorID__moz_menubar:
aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
break;

View File

@ -205,6 +205,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
idx = COLOR_INFOTEXT;
break;
case eColorID_menu:
case eColorID__moz_menubar:
idx = COLOR_MENU;
break;
case eColorID_menutext:

View File

@ -194,6 +194,7 @@ const char nsXPLookAndFeel::sColorPrefs[][38] =
"ui.-moz_buttonhovertext",
"ui.-moz_menuhover",
"ui.-moz_menuhovertext",
"ui.-moz_menubar",
"ui.-moz_menubartext",
"ui.-moz_menubarhovertext",
"ui.-moz_eventreerow",