summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-29 13:22:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-29 13:25:06 +0000
commit8114a779143a7f0042d7e15b476037315ed2b4c3 (patch)
tree9af5c28059d2db5c97fa6f3b5fe7b7042deb0fd7
parent19c34aa67a4055273093b22f566df241755f0998 (diff)
Resolves: tdf#90214 set gtk[2|3] lightshadow halfway between darkshadow and bg
Change-Id: Ie8d41c6b507c837f369b34b6a0290da02f0a1665 (cherry picked from commit 308b0fcd2081e2a2665b572d62f7f07de85e2b45)
-rw-r--r--vcl/unx/gtk/salnativewidgets-gtk.cxx24
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx9
2 files changed, 18 insertions, 15 deletions
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index b9bb56a7027f..a3eea1636475 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -3979,6 +3979,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
Color aDarkShadowColor = getColor( pStyle->fg[GTK_STATE_INSENSITIVE] );
aStyleSet.SetDarkShadowColor( aDarkShadowColor );
+ int nRedDiff = aBackFieldColor.GetRed() - aDarkShadowColor.GetRed();
+ int nGreenDiff = aBackFieldColor.GetGreen() - aDarkShadowColor.GetGreen();
+ int nBlueDiff = aBackFieldColor.GetBlue() - aDarkShadowColor.GetBlue();
+
+ Color aShadowColor(aBackFieldColor.GetRed() + nRedDiff / 2,
+ aBackFieldColor.GetGreen() + nGreenDiff / 2,
+ aBackFieldColor.GetBlue() + nBlueDiff / 2);
+ aStyleSet.SetShadowColor( aShadowColor );
+
// highlighting colors
Color aHighlightColor = getColor( pStyle->base[GTK_STATE_SELECTED] );
Color aHighlightTextColor = getColor( pStyle->text[GTK_STATE_SELECTED] );
@@ -4044,21 +4053,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
std::fprintf( stderr, "DarkShadowColor = %x (%d)\n", (int)aStyleSet.GetDarkShadowColor().GetColor(), aStyleSet.GetDarkShadowColor().GetLuminance() );
#endif
- // 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 );
- }
-
aHighlightColor = getColor( pMenuItemStyle->bg[ GTK_STATE_SELECTED ] );
aHighlightTextColor = getColor( pMenuItemStyle->fg[ GTK_STATE_SELECTED ] );
aStyleSet.SetMenuHighlightColor( aHighlightColor );
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 8090f6857e9b..f8be136ccd2b 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2583,6 +2583,15 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
::Color aDarkShadowColor = getColor( color );
aStyleSet.SetDarkShadowColor( aDarkShadowColor );
+ int nRedDiff = aBackFieldColor.GetRed() - aDarkShadowColor.GetRed();
+ int nGreenDiff = aBackFieldColor.GetGreen() - aDarkShadowColor.GetGreen();
+ int nBlueDiff = aBackFieldColor.GetBlue() - aDarkShadowColor.GetBlue();
+
+ ::Color aShadowColor(aBackFieldColor.GetRed() + nRedDiff / 2,
+ aBackFieldColor.GetGreen() + nGreenDiff / 2,
+ aBackFieldColor.GetBlue() + nBlueDiff / 2);
+ aStyleSet.SetShadowColor( aShadowColor );
+
g_object_unref( pCStyle );
// Tab colors