[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Feb 12 13:13:14 UTC 2016


 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |   24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

New commits:
commit e6d6e35320984fe4198314e3ea3a91ead6b41392
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 12 13:11:37 2016 +0000

    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

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 4f103ae..b0211c4 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 );


More information about the Libreoffice-commits mailing list