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:24:36 +0000
commit308b0fcd2081e2a2665b572d62f7f07de85e2b45 (patch)
tree3100a2c475cc1ff1adcb575a6c1ed376160a8ea6
parente006b9cf2cfba5995b97a9a9551d362b7eb45572 (diff)
Resolves: tdf#90214 set gtk[2|3] lightshadow halfway between darkshadow and bg
Change-Id: Ie8d41c6b507c837f369b34b6a0290da02f0a1665
-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