From 2139e819c3f3d0663612161c8b72f9c93928c7d4 Mon Sep 17 00:00:00 2001 From: Sylvester Keil Date: Thu, 29 Nov 2018 11:57:04 +0100 Subject: [PATCH] Fix GTK menubar item color Use menubar item color (not menu item color). Closes #15194 --- atom/browser/ui/views/menu_bar.cc | 13 +++++-------- patches/common/chromium/libgtkui_export.patch | 9 +++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/atom/browser/ui/views/menu_bar.cc b/atom/browser/ui/views/menu_bar.cc index 39e1614dc5ce9..47626176d3509 100644 --- a/atom/browser/ui/views/menu_bar.cc +++ b/atom/browser/ui/views/menu_bar.cc @@ -7,7 +7,6 @@ #include #include #include -#include #include "atom/browser/ui/views/submenu_button.h" #include "atom/common/keyboard_util.h" @@ -268,13 +267,11 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) { theme = ui::NativeTheme::GetInstanceForNativeUi(); if (theme) { #if defined(USE_X11) - const std::string menubar_selector = "GtkMenuBar#menubar"; - background_color_ = libgtkui::GetBgColor(menubar_selector); - - enabled_color_ = theme->GetSystemColor( - ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor); - disabled_color_ = theme->GetSystemColor( - ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor); + background_color_ = libgtkui::GetBgColor("GtkMenuBar#menubar"); + enabled_color_ = libgtkui::GetFgColor( + "GtkMenuBar#menubar GtkMenuItem#menuitem GtkLabel"); + disabled_color_ = libgtkui::GetFgColor( + "GtkMenuBar#menubar GtkMenuItem#menuitem:disabled GtkLabel"); #else background_color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_MenuBackgroundColor); diff --git a/patches/common/chromium/libgtkui_export.patch b/patches/common/chromium/libgtkui_export.patch index 082ea8aec2148..323a250b5c860 100644 --- a/patches/common/chromium/libgtkui_export.patch +++ b/patches/common/chromium/libgtkui_export.patch @@ -39,6 +39,15 @@ index d9f245070249f5f153bd8fe11e0a5e718c7d3629..a0f033c3e3f7f3996897f5f969b2a209 // Gets the transient parent aura window for |dialog|. aura::Window* GetAuraTransientParent(GtkWidget* dialog); +@@ -180,7 +181,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css); + + // Get the 'color' property from the style context created by + // GetStyleContextFromCss(|css_selector|). +-SkColor GetFgColor(const std::string& css_selector); ++LIBGTKUI_EXPORT SkColor GetFgColor(const std::string& css_selector); + + ScopedCssProvider GetCssProvider(const std::string& css); + @@ -193,7 +194,7 @@ void RenderBackground(const gfx::Size& size, // Renders a background from the style context created by // GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and