vcl/source/treelist/svimpbox.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit 5f9cd841a22fa7eb6f29ca8b9a35a8b016fb3d56 Author: Rafael Lima <rafael.palma.l...@gmail.com> AuthorDate: Thu Oct 13 22:03:27 2022 +0200 Commit: Rafael Lima <rafael.palma.l...@gmail.com> CommitDate: Tue Nov 8 17:16:21 2022 +0100 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.tie...@documentfoundation.org> Tested-by: Jenkins 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(); }