summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-13 10:01:44 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-13 14:10:50 +0200
commitc900069dee03c5ebf631a5862b94cd2962cbaea0 (patch)
treec7a654679fe0efaf80775a8fd9b71a686617cd85 /sw/source/ui/docvw/HeaderFooterWin.cxx
parentd670cdcf33f93d67293ceca82ceff2cff7ba8a63 (diff)
Header/Footer: display improvements
Changed the following: + Draw a gradient in the separator tabs background + Draw a solid line under the dotted one to have a contrast for some page background colors.
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 65b4176f7515..d7c9c848199a 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -48,6 +48,7 @@
#include <editeng/ulspitem.hxx>
#include <svtools/svtdata.hxx>
#include <vcl/decoview.hxx>
+#include <vcl/gradient.hxx>
#include <vcl/menubtn.hxx>
#include <vcl/svapp.hxx>
@@ -69,16 +70,35 @@ namespace
return basegfx::tools::hsl2rgb( aHslLine );
}
+ basegfx::BColor lcl_GetLighterGradientColor( basegfx::BColor aDarkColor )
+ {
+ basegfx::BColor aHslDark = basegfx::tools::rgb2hsl( aDarkColor );
+ double nLuminance = aHslDark.getZ() * 255 + 20;
+ aHslDark.setZ( nLuminance / 255.0 );
+ return basegfx::tools::hsl2rgb( aHslDark );
+ }
+
void lcl_DrawBackground( OutputDevice* pOut, const Rectangle& rRect, bool bHeader )
{
// Colors
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
basegfx::BColor aFillColor = lcl_GetFillColor( aLineColor );
+ basegfx::BColor aLighterColor = lcl_GetLighterGradientColor( aFillColor );
+
+ // Draw the background gradient
+ Gradient aGradient;
+ if ( bHeader )
+ aGradient = Gradient( GRADIENT_LINEAR,
+ Color( aLighterColor ), Color( aFillColor ) );
+ else
+ aGradient = Gradient( GRADIENT_LINEAR,
+ Color( aFillColor ), Color( aLighterColor ) );
+
+ pOut->DrawGradient( rRect, aGradient );
- // Draw the background rect
pOut->SetFillColor( Color ( aFillColor ) );
pOut->SetLineColor( Color ( aFillColor ) );
- pOut->DrawRect( rRect );
+
// Draw the lines around the rect
pOut->SetLineColor( Color( aLineColor ) );