diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-25 10:02:54 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-01-26 13:17:17 +0000 |
commit | ef7aefef00bddb5008a4fd071f547cef14ce0c3e (patch) | |
tree | 8cdcbc09f9690e82b367c1c6827ea0d1bc05c9bc /vcl | |
parent | a6f3ca06100bc23eee5017d6cf53e89282dc580d (diff) |
Resolves: tdf#104598 make bright theme shadow the same as it always was
The shadow color was originally set via StyleSettings::Set3DColors taking the
background color as the input, and doing DecreaseLuminance(64) on it to make
the shadow color
So, continue to follow that mode if the "dark shadow" is darker than the
foreground, and IncreaseLuminance the equal amount the other direction for dark
themes.
This way under a dark theme the problem of impossible to see rulers of
tdf#90214 is still fixed, while the bright theme colors are the same as they
always were, which avoid the wearing-on-the-nerves "regression" problem.
Change-Id: I33133ff180ecadce3a14ee45bd33db73c56c0225
(cherry picked from commit 19663d39f400dac3682228f3f0146807bbbebe74)
Reviewed-on: https://gerrit.libreoffice.org/33523
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/salnativewidgets-gtk.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index a3eea1636475..43cc67571290 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -3979,14 +3979,12 @@ 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 ); + ::Color aShadowColor(aBackColor); + if (aDarkShadowColor.GetLuminance() > aBackColor.GetLuminance()) + aShadowColor.IncreaseLuminance(64); + else + aShadowColor.DecreaseLuminance(64); + aStyleSet.SetShadowColor(aShadowColor); // highlighting colors Color aHighlightColor = getColor( pStyle->base[GTK_STATE_SELECTED] ); diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 945e68b4e83f..729b6f500323 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2583,14 +2583,12 @@ 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 ); + ::Color aShadowColor(aBackColor); + if (aDarkShadowColor.GetLuminance() > aBackColor.GetLuminance()) + aShadowColor.IncreaseLuminance(64); + else + aShadowColor.DecreaseLuminance(64); + aStyleSet.SetShadowColor(aShadowColor); g_object_unref( pCStyle ); |