Resolves tdf#152923 - Make column header outstanding from background
* Background color made darker/lighter depending on system settings
* Separator lines with less contrast (ShadowColor instead of DarkShadowColor)
* Extra line for selection removed as it extends the actual header
* Todo: Vertical header starts at a few pixels distance to the edge (patchset 4 fails)
Change-Id: If3c47b77ad0bca2db1c25ec46b488a2e338b8133
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168225
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index ec64067..251f9f6 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -321,7 +321,12 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
if ( nLineEnd * nLayoutSign >= nInitScrPos * nLayoutSign )
{
GetOutDev()->SetFillColor( rStyleSettings.GetFaceColor() );
Color aFaceColor(rStyleSettings.GetFaceColor());
if (bDark)
aFaceColor.IncreaseLuminance(20);
else
aFaceColor.DecreaseLuminance(20);
GetOutDev()->SetFillColor( aFaceColor );
if ( bVertical )
aFillRect = tools::Rectangle( 0, nInitScrPos, nBarSize-1, nLineEnd );
else
@@ -374,26 +379,16 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
}
}
GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
GetOutDev()->SetLineColor( rStyleSettings.GetShadowColor() );
if (bVertical)
{
tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
GetOutDev()->DrawLine( Point( nDarkPos, nPStart ), Point( nDarkPos, nLineEnd ) );
GetOutDev()->DrawLine( Point( 0, nPStart ), Point( 0, nLineEnd ) ); //left
GetOutDev()->DrawLine( Point( nBarSize-1, nPStart ), Point( nBarSize-1, nLineEnd ) ); //right
}
else
GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) );
// line in different color for selection
if ( nTransEnd * nLayoutSign >= nTransStart * nLayoutSign && !bHighContrast )
{
GetOutDev()->SetLineColor(aSelLineColor);
if (bVertical)
{
tools::Long nDarkPos = bMirrored ? 0 : nBarSize-1;
GetOutDev()->DrawLine( Point( nDarkPos, nTransStart ), Point( nDarkPos, nTransEnd ) );
}
else
GetOutDev()->DrawLine( Point( nTransStart, nBarSize-1 ), Point( nTransEnd, nBarSize-1 ) );
GetOutDev()->DrawLine( Point( nPStart, nBarSize-1 ), Point( nLineEnd, nBarSize-1 ) ); //bottom
GetOutDev()->DrawLine( Point( nPStart, 0 ), Point( nLineEnd, 0 ) ); //top
}
}
@@ -464,10 +459,10 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const tools
{
case SC_HDRPAINT_SEL_BOTTOM:
// same as non-selected for high contrast
GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetDarkShadowColor() : aSelLineColor );
GetOutDev()->SetLineColor( bHighContrast ? rStyleSettings.GetShadowColor() : aSelLineColor );
break;
case SC_HDRPAINT_BOTTOM:
GetOutDev()->SetLineColor( rStyleSettings.GetDarkShadowColor() );
GetOutDev()->SetLineColor( rStyleSettings.GetShadowColor() );
break;
case SC_HDRPAINT_TEXT:
// DrawSelectionBackground is used only for high contrast on light background
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 17e4d88..8eba950 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -101,7 +101,7 @@ void ScCornerButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
tools::Long nDarkX = bLayoutRTL ? 0 : nPosX;
// both buttons have the same look now - only dark right/bottom lines
rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
rRenderContext.DrawLine(Point(0, nPosY), Point(nPosX, nPosY));
rRenderContext.DrawLine(Point(nDarkX, 0), Point(nDarkX, nPosY));
}