svtools/source/control/valueset.cxx |   33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

New commits:
commit 0c9f93e9079a60725e6ff62bfc4a6a8a7254680e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Feb 15 13:18:06 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Feb 15 16:56:24 2023 +0000

    tdf#153633 color description in chart colors options always black
    
    even in dark mode. There are some other visual glitches here, just
    erase the rendercontext before drawing to it.
    
    Change-Id: I487375614c654124e116c3e9f28d78bf7f87da4e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147087
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 069379779d61..96f940555965 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -255,16 +255,8 @@ IMPL_LINK(ValueSet, ImplScrollHdl, weld::ScrolledWindow&, 
rScrollWin, void)
 
 void ValueSet::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
-    if (GetStyle() & WB_FLATVALUESET)
-    {
-        const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-        rRenderContext.SetLineColor();
-        rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
-        tools::Long nOffY = maVirDev->GetOutputSizePixel().Height();
-        Size aWinSize(GetOutputSizePixel());
-        rRenderContext.DrawRect(tools::Rectangle(Point(0, nOffY ), Point( 
aWinSize.Width(), aWinSize.Height())));
-    }
-
+    
rRenderContext.SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
+    rRenderContext.Erase();
     ImplDraw(rRenderContext);
 }
 
@@ -1515,22 +1507,17 @@ void ValueSet::ImplDrawItemText(vcl::RenderContext& 
rRenderContext, const OUStri
     tools::Long nTxtWidth = rRenderContext.GetTextWidth(rText);
     tools::Long nTxtOffset = mnTextOffset;
 
+    rRenderContext.Push(vcl::PushFlags::TEXTCOLOR);
+
     // delete rectangle and show text
-    if (GetStyle() & WB_FLATVALUESET)
-    {
-        const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-        rRenderContext.SetLineColor();
-        rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
-        rRenderContext.DrawRect(tools::Rectangle(Point(0, nTxtOffset), 
Point(aWinSize.Width(), aWinSize.Height())));
-        rRenderContext.SetTextColor(rStyleSettings.GetButtonTextColor());
-    }
-    else
-    {
+    const bool bFlat(GetStyle() & WB_FLATVALUESET);
+    if (!bFlat)
         nTxtOffset += NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
-        
rRenderContext.SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
-        rRenderContext.Erase(tools::Rectangle(Point(0, nTxtOffset), 
Point(aWinSize.Width(), aWinSize.Height())));
-    }
+
+    
rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetButtonTextColor());
     rRenderContext.DrawText(Point((aWinSize.Width() - nTxtWidth) / 2, 
nTxtOffset + (NAME_OFFSET / 2)), rText);
+
+    rRenderContext.Pop();
 }
 
 void ValueSet::StyleUpdated()

Reply via email to