cui/source/dialogs/colorpicker.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit ef45f4fcfb5826f6456c01df18317598a2ed8dfa
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Oct 6 12:31:03 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Mon Oct 6 14:23:26 2025 +0200

    tdf#168125 Black bar next to the color preview in the color picker dialog
    
    regression from
      commit 088a7c7c451321a800ca8d3523a18b6bb93239b7
      Author: Noel Grandin <[email protected]>
      Date:   Tue Sep 24 16:18:11 2024 +0200
      remove alpha device from OutputDevice
    
    Change-Id: I610a479c14f278718b801094dbe9ba1a2592e9f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191958
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/cui/source/dialogs/colorpicker.cxx 
b/cui/source/dialogs/colorpicker.cxx
index 55e6500577d2..c150c5fc72f5 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -21,6 +21,7 @@
 
 #include <vcl/ColorDialog.hxx>
 #include <vcl/event.hxx>
+#include <vcl/svapp.hxx>
 #include <basegfx/color/bcolortools.hxx>
 #include <cmath>
 #include <o3tl/typed_flags_set.hxx>
@@ -89,8 +90,13 @@ static void RGBtoCMYK( double dR, double dG, double dB, 
double& fCyan, double& f
 
 void ColorPreviewControl::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
-    rRenderContext.SetFillColor(m_aColor);
-    rRenderContext.SetLineColor(m_aColor);
+    Color aCol = m_aColor;
+    // If the color has been set to transparent, we need to paint a block that 
matches the dialog
+    // background.
+    if (aCol.GetAlpha() == 0)
+        aCol = Application::GetSettings().GetStyleSettings().GetDialogColor();
+    rRenderContext.SetFillColor(aCol);
+    rRenderContext.SetLineColor(aCol);
     rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), 
GetOutputSizePixel()));
 }
 

Reply via email to