summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-15 13:18:06 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2023-02-16 08:24:39 +0000
commitde7a636cb5a5527a7e9ab506c3a7829607cd6f11 (patch)
treec9357e802d23cc7b9216b775b8b0adafeb7cac02
parent210309068999bed735cc6138f316c3190494835d (diff)
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/+/147072 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--svtools/source/control/valueset.cxx33
1 files changed, 10 insertions, 23 deletions
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()