Skip to content

Commit

Permalink
[linux] fixed foreground colors for menubar
Browse files Browse the repository at this point in the history
Foreground colors used by menubar buttons should be consistent
with themes provided by the system. We use same foreground color
as menu items.

fixed nwjs#5007
  • Loading branch information
Cong Liu committed Jun 23, 2016
1 parent 939c982 commit d6c6062
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/browser/menubar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class MenuBarButton : public views::MenuButton {
return !tooltip->empty();
}

void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
views::MenuButton::OnNativeThemeChanged(theme);
SetEnabledTextColors(theme->GetSystemColor(ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor));
}

private:

DISALLOW_COPY_AND_ASSIGN(MenuBarButton);
Expand Down Expand Up @@ -107,8 +112,11 @@ void MenuBarView::ButtonPressed(views::Button* sender,
}

void MenuBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
set_background(views::Background::CreateSolidBackground(GetNativeTheme()->
// Use menu background color for menubar
set_background(views::Background::CreateSolidBackground(theme->
GetSystemColor(ui::NativeTheme::kColorId_MenuBackgroundColor)));
// Force to repaint the menubar
SchedulePaint();
}

} //namespace nw

0 comments on commit d6c6062

Please sign in to comment.