diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-05 14:04:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-05 14:05:09 +0000 |
commit | 710d034467a96270175d6a1edf8d655a8345a4c3 (patch) | |
tree | fa8911d677aedd63006d07070c1061010564f147 /vcl | |
parent | 307507fe06c679980ff450365ee10f4602454b96 (diff) |
set parent styles to fall back to
makes menubar font get correct color for me under f21
Change-Id: I5ef842cc151e07d13a0dca7a982f0e2d95e5c6d6
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 56b39dbec7b9..a3948e9610b2 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1140,6 +1140,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) gtk_widget_path_append_type( pCPath, GTK_TYPE_TEXT_VIEW ); gtk_widget_path_iter_add_class( pCPath, -1, GTK_STYLE_CLASS_VIEW ); gtk_style_context_set_path( pCStyle, pCPath ); + gtk_style_context_set_parent(pCStyle, gtk_widget_get_style_context(mpWindow)); gtk_widget_path_free( pCPath ); GdkRGBA field_background_color; gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &field_background_color); @@ -1434,6 +1435,7 @@ void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget) { *style = gtk_widget_get_style_context(widget); g_object_ref(*style); + gtk_style_context_set_parent(*style, gtk_widget_get_style_context(mpWindow)); gtk_widget_destroy(widget); } @@ -1444,11 +1446,9 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) { m_xTextRenderImpl.reset(new GtkCairoTextRender(*this)); - if(style_loaded) + if (style_loaded) return; - GtkWidgetPath* path; - style_loaded = true; gtk_init(NULL, NULL); /* Load the GtkStyleContexts, it might be a bit slow, but usually, @@ -1464,14 +1464,15 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) getStyleContext(&mpToolButtonStyle, gtk_button_new()); /* Create a widget path for our toolbutton widget */ - path = gtk_widget_path_new(); + GtkWidgetPath* path = gtk_widget_path_new(); gtk_widget_path_append_type(path, GTK_TYPE_TOOLBAR); gtk_widget_path_append_type(path, GTK_TYPE_TOOL_BUTTON); gtk_widget_path_append_type(path, GTK_TYPE_BUTTON); gtk_widget_path_iter_add_class (path, 0, GTK_STYLE_CLASS_PRIMARY_TOOLBAR); - gtk_widget_path_iter_add_class (path, 0, GTK_STYLE_CLASS_TOOLBAR); + gtk_widget_path_iter_add_class (path, 1, GTK_STYLE_CLASS_TOOLBAR); gtk_widget_path_iter_add_class (path, 2, GTK_STYLE_CLASS_BUTTON); gtk_style_context_set_path(mpToolButtonStyle, path); + gtk_style_context_set_parent(mpToolButtonStyle, gtk_widget_get_style_context(mpWindow)); gtk_widget_path_free (path); getStyleContext(&mpVScrollbarStyle, gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL)); @@ -1492,6 +1493,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) gtk_widget_path_iter_add_class(path, 1, GTK_STYLE_CLASS_MENUITEM); mpMenuItemStyle = gtk_style_context_new(); gtk_style_context_set_path(mpMenuItemStyle, path); + gtk_style_context_set_parent(mpMenuItemStyle, mpMenuStyle); gtk_widget_path_free(path); /* Menu bar */ @@ -1504,6 +1506,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) /* Combobox */ mpComboboxStyle = gtk_style_context_new(); PrepareComboboxStyle(mpComboboxStyle, true); + gtk_style_context_set_parent(mpComboboxStyle, gtk_widget_get_style_context(mpWindow)); /* Listbox */ mpListboxStyle = gtk_style_context_new(); @@ -1512,6 +1515,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) gtk_widget_path_append_type(path, GTK_TYPE_BUTTON); gtk_widget_path_iter_add_class(path, 1, GTK_STYLE_CLASS_BUTTON); gtk_style_context_set_path(mpListboxStyle, path); + gtk_style_context_set_parent(mpListboxStyle, gtk_widget_get_style_context(mpWindow)); gtk_widget_path_free(path); } |