mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
committed by
deepak1556
parent
c957215854
commit
85bb488732
@@ -286,9 +286,8 @@ void MenuBar::OnMenuButtonClicked(views::Button* source,
|
||||
menu_delegate->AddObserver(this);
|
||||
}
|
||||
|
||||
void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
||||
if (!theme)
|
||||
theme = ui::NativeTheme::GetInstanceForNativeUi();
|
||||
void MenuBar::RefreshColorCache() {
|
||||
const ui::NativeTheme* theme = GetNativeTheme();
|
||||
if (theme) {
|
||||
#if defined(USE_X11)
|
||||
background_color_ = libgtkui::GetBgColor("GtkMenuBar#menubar");
|
||||
@@ -306,8 +305,8 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void MenuBar::OnNativeThemeChanged(const ui::NativeTheme* theme) {
|
||||
RefreshColorCache(theme);
|
||||
void MenuBar::OnThemeChanged() {
|
||||
RefreshColorCache();
|
||||
UpdateViewColors();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class MenuBar : public views::AccessiblePaneView,
|
||||
void OnMenuButtonClicked(views::Button* source,
|
||||
const gfx::Point& point,
|
||||
const ui::Event* event) override;
|
||||
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
|
||||
void OnThemeChanged() override;
|
||||
|
||||
private:
|
||||
friend class MenuBarColorUpdater;
|
||||
@@ -90,7 +90,7 @@ class MenuBar : public views::AccessiblePaneView,
|
||||
void RebuildChildren();
|
||||
void UpdateViewColors();
|
||||
|
||||
void RefreshColorCache(const ui::NativeTheme* theme = nullptr);
|
||||
void RefreshColorCache();
|
||||
SkColor background_color_;
|
||||
#if defined(USE_X11)
|
||||
SkColor enabled_color_;
|
||||
|
||||
Reference in New Issue
Block a user