diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-02-12 13:11:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-02-12 13:12:49 +0000 |
commit | e6d6e35320984fe4198314e3ea3a91ead6b41392 (patch) | |
tree | 957f4bf5de4fedc1bed53a2083ce8e04de8899a8 /vcl | |
parent | f1bb29ff34ef7a8adf3d4cdfba1108db6df87da2 (diff) |
Related: rhbz#1287593 issue 8, set a 'dark shadow' color based on the theme
pick something that is supposed to be a large contrast against the bg but
is different from the fg
Change-Id: I36d2f9e5aff0e06e89dbb41250e09f9cc972cd4c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 4f103ae0504b..b0211c43d220 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -1929,13 +1929,20 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) GdkRGBA field_background_color; gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL); gtk_style_context_get_background_color(pCStyle, gtk_style_context_get_state(pCStyle), &field_background_color); - g_object_unref( pCStyle ); ::Color aBackFieldColor = getColor( field_background_color ); aStyleSet.SetFieldColor( aBackFieldColor ); // This baby is the default page/paper color aStyleSet.SetWindowColor( aBackFieldColor ); + // Dark shadow color + gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_INSENSITIVE); + gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &color); + ::Color aDarkShadowColor = getColor( color ); + aStyleSet.SetDarkShadowColor( aDarkShadowColor ); + + g_object_unref( pCStyle ); + // Tab colors aStyleSet.SetActiveTabColor( aBackFieldColor ); // same as the window color. aStyleSet.SetInactiveTabColor( aBackColor ); @@ -1974,21 +1981,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) ); aStyleSet.SetMenuBarHighlightTextColor( aTextColor ); - // Awful hack for menu separators in the Sonar and similar themes. - // If the menu color is not too dark, and the menu text color is lighter, - // make the "light" color lighter than the menu color and the "shadow" - // color darker than it. - if ( aStyleSet.GetMenuColor().GetLuminance() >= 32 && - aStyleSet.GetMenuColor().GetLuminance() <= aStyleSet.GetMenuTextColor().GetLuminance() ) - { - ::Color temp = aStyleSet.GetMenuColor(); - temp.IncreaseLuminance( 8 ); - aStyleSet.SetLightColor( temp ); - temp = aStyleSet.GetMenuColor(); - temp.DecreaseLuminance( 16 ); - aStyleSet.SetShadowColor( temp ); - } - gtk_style_context_set_state(mpMenuItemStyle, GTK_STATE_FLAG_PRELIGHT); gtk_style_context_get_background_color( mpMenuItemStyle, gtk_style_context_get_state(mpMenuItemStyle), &background_color ); ::Color aHighlightColor = getColor( background_color ); |