summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/hdrcont.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-27 09:38:44 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-27 09:38:44 +0000
commitbe2153137439b5046ad480e0574afea0f445f567 (patch)
tree1fe62490e8fcb8207d66cbca87a14975c509d49b /sc/source/ui/view/hdrcont.cxx
parentb77e11ba9ec4006f0ca7040ac3fc09e9ceadfde9 (diff)
INTEGRATION: CWS calc10 (1.10.44); FILE MERGED
2003/05/21 18:55:20 nn 1.10.44.1: #109814# use DrawSelectionBackground instead of DrawTransparent to show selection
Diffstat (limited to 'sc/source/ui/view/hdrcont.cxx')
-rw-r--r--sc/source/ui/view/hdrcont.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 675d30cc556f..bfeaa7bf0bd1 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: hdrcont.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: hr $ $Date: 2003-03-26 18:06:47 $
+ * last change: $Author: vg $ $Date: 2003-05-27 10:38:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,8 +97,6 @@
#define SC_HDRPAINT_TEXT 6
#define SC_HDRPAINT_COUNT 7
-#define SC_HDR_TRANSPARENCY 85
-
//==================================================================
ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEngine,
@@ -260,7 +258,8 @@ void __EXPORT ScHeaderControl::Paint( const Rectangle& rRect )
// Linien zusammengefasst
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bDark = ( rStyleSettings.GetFaceColor().GetLuminance() <= 25 );
+ BOOL bDark = rStyleSettings.GetFaceColor().IsDark();
+ // Use the same distinction for bDark as in Window::DrawSelectionBackground
Color aTextColor = rStyleSettings.GetButtonTextColor();
SetTextColor( aTextColor );
@@ -415,18 +414,22 @@ void __EXPORT ScHeaderControl::Paint( const Rectangle& rRect )
case SC_HDRPAINT_TEXT:
if ( nTransEnd >= nTransStart && !bDark )
{
- // transparent selection background is drawn after lines, before text
+ // Transparent selection background is drawn after lines, before text.
+ // #109814# Use DrawSelectionBackground to make sure there is a visible
+ // difference. The case of a dark face color, where DrawSelectionBackground
+ // would just paint over the lines, is handled separately (bDark).
+ // Otherwise, GetHighlightColor is used with 80% transparency.
+ // The window's background color (SetBackground) has to be the background
+ // of the cell area, for the contrast comparison in DrawSelectionBackground.
- SetLineColor();
- SetFillColor( rStyleSettings.GetActiveColor() );
Rectangle aTransRect;
if (bVertical)
aTransRect = Rectangle( 0, nTransStart, nBarSize-1, nTransEnd );
else
aTransRect = Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
- Polygon aPoly( aTransRect );
- PolyPolygon aPolyPoly( aPoly );
- DrawTransparent( aPolyPoly, SC_HDR_TRANSPARENCY );
+ SetBackground( Color( rStyleSettings.GetFaceColor() ) );
+ DrawSelectionBackground( aTransRect, 0, TRUE, FALSE, FALSE );
+ SetBackground();
}
break;
}