diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 98efe96766..0f5f4de5fe 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -156,16 +156,34 @@ static void bg(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA) { GtkStyleContext* sc = gtk_widget_get_style_context(widget); gtk_style_context_get_background_color(sc, state, &gdkRGBA); + if (gdkRGBA.alpha <= 0) + { + widget = gtk_widget_get_parent(GTK_WIDGET(ContainerWidget())); + sc = gtk_widget_get_style_context(widget); + gtk_style_context_get_background_color(sc, state, &gdkRGBA); + } } static void fg(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA) { GtkStyleContext* sc = gtk_widget_get_style_context(widget); gtk_style_context_get_color(sc, state, &gdkRGBA); + if (gdkRGBA.alpha <= 0) + { + widget = gtk_widget_get_parent(GTK_WIDGET(ContainerWidget())); + sc = gtk_widget_get_style_context(widget); + gtk_style_context_get_color(sc, state, &gdkRGBA); + } } static void border(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA) { GtkStyleContext* sc = gtk_widget_get_style_context(widget); gtk_style_context_get_border_color(sc, state, &gdkRGBA); + if (gdkRGBA.alpha <= 0) + { + widget = gtk_widget_get_parent(GTK_WIDGET(ContainerWidget())); + sc = gtk_widget_get_style_context(widget); + gtk_style_context_get_border_color(sc, state, &gdkRGBA); + } } wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) @@ -235,14 +253,21 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) break; case wxSYS_COLOUR_ACTIVECAPTION: case wxSYS_COLOUR_MENUHILIGHT: - bg(MenuItemWidget(), GTK_STATE_FLAG_SELECTED, gdkRGBA); + bg(MenuItemWidget(), GTK_STATE_FLAG_PRELIGHT, gdkRGBA); break; case wxSYS_COLOUR_MENUTEXT: fg(MenuItemWidget(), GTK_STATE_FLAG_NORMAL, gdkRGBA); break; case wxSYS_COLOUR_APPWORKSPACE: case wxSYS_COLOUR_WINDOW: - bg(TextCtrlWidget(), GTK_STATE_FLAG_NORMAL, gdkRGBA); + { + GtkWidget* widget = TextCtrlWidget(); + GtkStyleContext* sc = gtk_widget_get_style_context(widget); + gtk_style_context_save(sc); + gtk_style_context_add_class(sc, GTK_STYLE_CLASS_VIEW); + bg(widget, GTK_STATE_FLAG_NORMAL, gdkRGBA); + gtk_style_context_restore(sc); + } break; case wxSYS_COLOUR_CAPTIONTEXT: {