Skip to content

Commit

Permalink
Bug 827075 - Implement the -moz-menubar color and make it return the …
Browse files Browse the repository at this point in the history
…correct background color on gtk; r=roc
  • Loading branch information
ehsan committed Jan 6, 2013
1 parent 423d664 commit d807a89
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions layout/style/nsCSSKeywordList.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions layout/style/nsCSSProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions widget/LookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class LookAndFeel
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
Expand Down
1 change: 1 addition & 0 deletions widget/android/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions widget/cocoa/nsLookAndFeel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ static nscolor GetColorFromNSColor(NSColor* aColor)
aColor = NS_RGB(0xDA,0xDA,0xDA);
break;
case eColorID_menu:
case eColorID__moz_menubar:
aColor = GetColorFromNSColor([NSColor alternateSelectedControlTextColor]);
break;
case eColorID_infobackground:
Expand Down
1 change: 1 addition & 0 deletions widget/gonk/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions widget/gtk2/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
Expand Down
1 change: 1 addition & 0 deletions widget/gtk2/nsLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class nsLookAndFeel: public nsXPLookAndFeel {
static nscolor sInfoBackground;
static nscolor sInfoText;
static nscolor sMenuBackground;
static nscolor sMenuBar;
static nscolor sMenuBarText;
static nscolor sMenuBarHoverText;
static nscolor sMenuText;
Expand Down
1 change: 1 addition & 0 deletions widget/os2/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions widget/qt/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions widget/windows/nsLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions widget/xpwidgets/nsXPLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d807a89

Please sign in to comment.