diff options
author | Rafael Lima <rafael.palma.lima@gmail.com> | 2022-10-13 22:03:27 +0200 |
---|---|---|
committer | Rafael Lima <rafael.palma.lima@gmail.com> | 2022-11-08 17:16:21 +0100 |
commit | 5f9cd841a22fa7eb6f29ca8b9a35a8b016fb3d56 (patch) | |
tree | c4394806399cd88baec63191a96e7574eb219d6f /vcl/source | |
parent | a6ec150a2ef80697aa724555ed1227fb0da382ca (diff) |
tdf#144587 Fix lines in treelists using dark mode
As reported by the user, the lines in a treelist are dark over a dark background. This patch fixes that.
Tested with kf5, gen and gtk3.
Change-Id: I7f1a206f4adba496d312b25a9db121df317c7c84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141315
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/treelist/svimpbox.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index b9a311822be1..63b4d928bfd5 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -1020,11 +1020,15 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) rRenderContext.Push(vcl::PushFlags::LINECOLOR); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - Color aCol = rStyleSettings.GetFaceColor(); - if (aCol.IsRGBEqual(rRenderContext.GetBackground().GetColor())) - aCol = rStyleSettings.GetShadowColor(); - rRenderContext.SetLineColor(aCol); + // Set color to draw the vertical and horizontal lines + Color aOldLineColor = rRenderContext.GetLineColor(); + Color aBackgroundColor = rRenderContext.GetBackground().GetColor(); + if (aBackgroundColor.IsDark()) + rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); + else + rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); + Point aPos1, aPos2; sal_uInt16 nDistance; sal_uLong nMax = m_nVisibleCount + nOffs + 1; @@ -1064,6 +1068,7 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) pEntry = m_pView->NextVisible(pEntry); } + rRenderContext.SetLineColor(aOldLineColor); rRenderContext.Pop(); } |