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 15:29:57 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-13 17:29:04 +0200
commite88eb733eda4fe3284d366a4cc0d20d3b1c80e85 (patch)
tree317c2d8b4b13c6e42febe80aa422092dea3a6fc9 /sw/source/ui/docvw/HeaderFooterWin.cxx
parent883991e8470075be1ade56595a90040d1ad64f6c (diff)
Header/Footer: handle high contrast mode in Paint method
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx45
1 files changed, 30 insertions, 15 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index edc09d880ffa..1f7bbaefb54b 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -79,25 +79,37 @@ namespace
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 );
+ const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
+ if ( rSettings.GetHighContrastMode() )
+ {
+ aLineColor = rSettings.GetDialogTextColor().getBColor();
- pOut->SetFillColor( Color ( aFillColor ) );
- pOut->SetLineColor( Color ( aFillColor ) );
+ pOut->SetFillColor( rSettings.GetDialogColor( ) );
+ pOut->SetLineColor( rSettings.GetDialogTextColor( ) );
+ pOut->DrawRect( rRect );
+ }
+ else
+ {
+ // Colors
+ 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 );
+
+ pOut->SetFillColor( Color ( aFillColor ) );
+ pOut->SetLineColor( Color ( aFillColor ) );
+ }
// Draw the lines around the rect
pOut->SetLineColor( Color( aLineColor ) );
@@ -203,7 +215,10 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
GetTextBoundRect( aTextRect, String( m_sLabel ) );
Point aTextPos = aTextRect.TopLeft() + Point( TEXT_PADDING, 0 );
+ const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
+ if ( rSettings.GetHighContrastMode( ) )
+ aLineColor = rSettings.GetDialogTextColor().getBColor();
SetTextColor( Color( aLineColor ) );
DrawText( aTextPos, String( m_sLabel ) );