summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-15 13:41:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-15 13:41:00 +0100
commit32bccdb8feebb1145cfb75e61c39c317b4931553 (patch)
treeda5584309e4dfe348b0e0cc62eed213138026312 /vcl
parent4ee3eabd0f058b26544c84b2b5aaf5478d921817 (diff)
gtk3: get tooltip color
Change-Id: I3328d4fad140793ddd4f6f1f1ac99741c20ba659
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx31
1 files changed, 21 insertions, 10 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 7ae15efb63ff..d8cd408eedfb 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1324,15 +1324,28 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetCheckedColorSpecialCase( );
// tooltip colors
- GdkRGBA tooltip_bg_color, tooltip_fg_color;
- gtk_style_context_save (pStyle);
- gtk_style_context_add_class (pStyle, GTK_STYLE_CLASS_TOOLTIP);
- gtk_style_context_get_color (pStyle, GTK_STATE_FLAG_NORMAL, &tooltip_fg_color);
- gtk_style_context_get_background_color (pStyle, GTK_STATE_FLAG_NORMAL, &tooltip_bg_color);
- gtk_style_context_restore (pStyle);
+ {
+ GtkStyleContext *pCStyle = gtk_style_context_new();
+ gtk_style_context_set_screen( pCStyle, gtk_window_get_screen( GTK_WINDOW( mpWindow ) ) );
+ GtkWidgetPath *pCPath = gtk_widget_path_new();
+ guint pos = gtk_widget_path_append_type(pCPath, GTK_TYPE_WINDOW);
+ gtk_widget_path_iter_add_class(pCPath, pos, GTK_STYLE_CLASS_TOOLTIP);
+ pos = gtk_widget_path_append_type (pCPath, GTK_TYPE_LABEL);
+#if GTK_CHECK_VERSION(3,16,0)
+ gtk_widget_path_iter_add_class(pCPath, pos, GTK_STYLE_CLASS_LABEL);
+#endif
+ pCStyle = gtk_style_context_new();
+ gtk_style_context_set_path(pCStyle, pCPath);
+ gtk_widget_path_free(pCPath);
- aStyleSet.SetHelpColor( getColor( tooltip_bg_color ));
- aStyleSet.SetHelpTextColor( getColor( tooltip_fg_color ));
+ GdkRGBA tooltip_bg_color, tooltip_fg_color;
+ gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_NORMAL, &tooltip_fg_color);
+ gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &tooltip_bg_color);
+ g_object_unref( pCStyle );
+
+ aStyleSet.SetHelpColor( getColor( tooltip_bg_color ));
+ aStyleSet.SetHelpTextColor( getColor( tooltip_fg_color ));
+ }
{
// construct style context for text view
@@ -1442,8 +1455,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
pos = gtk_widget_path_append_type (pCPath, GTK_TYPE_LABEL);
#if GTK_CHECK_VERSION(3,16,0)
gtk_widget_path_iter_add_class(pCPath, pos, GTK_STYLE_CLASS_LABEL);
-#else
- gtk_widget_path_iter_set_name(pCPath, pos, "first tab label");
#endif
pCStyle = gtk_style_context_new();
gtk_style_context_set_path(pCStyle, pCPath);