[graphics/krita] libs/ui: Show color strip at the bottom of assistant editor

Dmitry Kazakov <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 5004cabf21949ef29728366627abf93c1b37f29d by Dmitry Kazakov, on behalf of Carsten Hartenfels.
Committed on 07/08/2026 at 12:24.
Pushed by dkazakov into branch 'master'.

Show color strip at the bottom of assistant editor

If they have a custom color assigned, to make it easy to spot which
editor widget belongs to which assistant.

M  +19   -1    libs/ui/kis_painting_assistants_decoration.cpp

https://invent.kde.org/graphics/krita/-/commit/5004cabf21949ef29728366627abf93c1b37f29d

diff --git a/libs/ui/kis_painting_assistants_decoration.cpp b/libs/ui/kis_painting_assistants_decoration.cpp
index 09e659b6dbc..7d50370c2c4 100644
--- a/libs/ui/kis_painting_assistants_decoration.cpp
+++ b/libs/ui/kis_painting_assistants_decoration.cpp
@@ -636,7 +636,11 @@ void KisPaintingAssistantsDecoration::drawEditorWidget(KisPaintingAssistantSP as
 
 
     QPainterPath bgPath;
-    bgPath.addRoundedRect(QRectF(actionsBGRectangle.x(), actionsBGRectangle.y(), globalEditorWidgetData.boundingSize.width(), globalEditorWidgetData.boundingSize.height()), 6, 6);
+    QRectF bgRect(actionsBGRectangle.x(),
+                  actionsBGRectangle.y(),
+                  globalEditorWidgetData.boundingSize.width(),
+                  globalEditorWidgetData.boundingSize.height());
+    bgPath.addRoundedRect(bgRect, 6, 6);
 
 
     // if the assistant is selected, make outline stroke fatter and use theme's highlight color
@@ -653,6 +657,20 @@ void KisPaintingAssistantsDecoration::drawEditorWidget(KisPaintingAssistantSP as
     gc.drawPath(bgPath);
     gc.fillPath(bgPath, backgroundColor);
 
+    // If the assistant uses a custom color, draw a colored strip at the bottom
+    // of the editor rectangle so that the association is clear.
+    if (assistant->useCustomColor()) {
+        KoColor c;
+        c.fromQColor(assistant->effectiveAssistantColor());
+        QColor assistantColor = renderInterface->convertColorToDisplayColorSpace(c);
+        assistantColor.setAlpha(255); // No point in having transparency here.
+
+        gc.save();
+        gc.setClipPath(bgPath, Qt::IntersectClip);
+        gc.fillRect(QRectF(QPointF(bgRect.left(), bgRect.bottom() - 4.0), bgRect.bottomRight()), assistantColor);
+        gc.restore();
+    }
+
     //draw drag handle
     KoColor c;
     c.fromQColor(QColor(150,150,150,255));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.