diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-05-10 20:50:36 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-27 14:39:42 +0100 |
commit | 2f874b85b2374f9d609db44ba03210812c8fb405 (patch) | |
tree | 22629aeeb881b2d0b039a37fce36916d958937d3 /vcl | |
parent | 6fbbea7dca8b3f1a5f794191ea42cc12b990cc9c (diff) |
gtk3: fix tooltip colors
Change-Id: Iacd8578ee71c5e0403c3398cb1f8d427be27d603
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 73e9e5dc6002..e5bd3d027d33 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1153,18 +1153,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetButtonRolloverTextColor( aTextColor ); aStyleSet.SetFieldRolloverTextColor( aTextColor ); - // FIXME: each gtk3 theme needs to define a set of well-known - // color names for LibreOffice eg. - // @define-color tooltip_bg_color #343434; - GdkRGBA tooltip_bg_color; - if( gtk_style_context_lookup_color( pStyle, "tooltip_bg_color", &tooltip_bg_color ) ) - { - aStyleSet.SetHelpTextColor( getColor( tooltip_bg_color ) ); - fprintf (stderr, "Set tooltip bg color %g %g %g %g\n", - tooltip_bg_color.red, tooltip_bg_color.green, - tooltip_bg_color.blue, tooltip_bg_color.alpha ); - } - // background colors GdkRGBA background_color; gtk_style_context_get_background_color(pStyle, GTK_STATE_FLAG_NORMAL, &background_color); @@ -1176,6 +1164,25 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetWorkspaceColor( aBackColor ); aStyleSet.SetCheckedColorSpecialCase( ); + // highlighting colors + gtk_style_context_get_background_color(pStyle, GTK_STATE_FLAG_SELECTED, &text_color); + ::Color aHighlightColor = getColor( text_color ); + gtk_style_context_get_color(pStyle, GTK_STATE_FLAG_SELECTED, &text_color); + ::Color aHighlightTextColor = getColor( text_color ); + aStyleSet.SetHighlightColor( aHighlightColor ); + aStyleSet.SetHighlightTextColor( aHighlightTextColor ); + + // 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); + + aStyleSet.SetHelpColor( getColor( tooltip_bg_color )); + aStyleSet.SetHelpTextColor( getColor( tooltip_fg_color )); + { // FIXME: turn me into a helper function ... // construct style context for text view GtkStyleContext *pCStyle = gtk_style_context_new(); @@ -1195,14 +1202,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetWindowColor( aBackFieldColor ); } - // highlighting colors - gtk_style_context_get_background_color(pStyle, GTK_STATE_FLAG_SELECTED, &text_color); - ::Color aHighlightColor = getColor( text_color ); - gtk_style_context_get_color(pStyle, GTK_STATE_FLAG_SELECTED, &text_color); - ::Color aHighlightTextColor = getColor( text_color ); - aStyleSet.SetHighlightColor( aHighlightColor ); - aStyleSet.SetHighlightTextColor( aHighlightTextColor ); - // menu disabled entries handling aStyleSet.SetSkipDisabledInMenus( sal_True ); aStyleSet.SetAcceleratorsInContextMenus( sal_False ); |