parent
cae2f1f537
commit
03ee12d13e
2 changed files with 6 additions and 7 deletions
|
@ -286,9 +286,8 @@ void MenuBar::OnMenuButtonClicked(views::Button* source,
|
||||||
menu_delegate->AddObserver(this);
|
menu_delegate->AddObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
void MenuBar::RefreshColorCache() {
|
||||||
if (!theme)
|
const ui::NativeTheme* theme = GetNativeTheme();
|
||||||
theme = ui::NativeTheme::GetInstanceForNativeUi();
|
|
||||||
if (theme) {
|
if (theme) {
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
background_color_ = libgtkui::GetBgColor("GtkMenuBar#menubar");
|
background_color_ = libgtkui::GetBgColor("GtkMenuBar#menubar");
|
||||||
|
@ -306,8 +305,8 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuBar::OnNativeThemeChanged(const ui::NativeTheme* theme) {
|
void MenuBar::OnThemeChanged() {
|
||||||
RefreshColorCache(theme);
|
RefreshColorCache();
|
||||||
UpdateViewColors();
|
UpdateViewColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ class MenuBar : public views::AccessiblePaneView,
|
||||||
void OnMenuButtonClicked(views::Button* source,
|
void OnMenuButtonClicked(views::Button* source,
|
||||||
const gfx::Point& point,
|
const gfx::Point& point,
|
||||||
const ui::Event* event) override;
|
const ui::Event* event) override;
|
||||||
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
|
void OnThemeChanged() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class MenuBarColorUpdater;
|
friend class MenuBarColorUpdater;
|
||||||
|
@ -90,7 +90,7 @@ class MenuBar : public views::AccessiblePaneView,
|
||||||
void RebuildChildren();
|
void RebuildChildren();
|
||||||
void UpdateViewColors();
|
void UpdateViewColors();
|
||||||
|
|
||||||
void RefreshColorCache(const ui::NativeTheme* theme = nullptr);
|
void RefreshColorCache();
|
||||||
SkColor background_color_;
|
SkColor background_color_;
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
SkColor enabled_color_;
|
SkColor enabled_color_;
|
||||||
|
|
Loading…
Reference in a new issue