[graphics/krita] plugins/dockers/widegamutcolorselector: Fix wg color selector popup appearing in the wrong location

Dmitry Kazakov <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fd590e6ab3e28a522628ffe3bdefe40c1cf1fdc2 by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 27/07/2026 at 12:05.
Pushed by dkazakov into branch 'master'.

Fix wg color selector popup appearing in the wrong location

Before this commit when the wg color selector is borrowed by the popup
palette, the preview popup would appear in the old docker location,
instead of where its supposed to

M  +3    -2    plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
M  +2    -0    plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h

https://invent.kde.org/graphics/krita/-/commit/fd590e6ab3e28a522628ffe3bdefe40c1cf1fdc2

diff --git a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
index 84613f9d43c..19de29acfd1 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
@@ -45,10 +45,11 @@ WGColorSelectorDock::WGColorSelectorDock()
     , m_actionManager(new WGActionManager(this))
     , m_colorTooltip(new WGColorPreviewToolTip(this))
     , m_colorModelBG(new KisVisualColorModel)
+    , m_mainWidget(new QWidget())
 {
     setWindowTitle(i18n("Wide Gamut Color Selector"));
 
-    QWidget *mainWidget = new QWidget();
+    QWidget *mainWidget = m_mainWidget;
     mainWidget->installEventFilter(this);
 
     m_mainWidgetLayout = new QVBoxLayout(mainWidget);
@@ -444,7 +445,7 @@ void WGColorSelectorDock::slotColorInteraction(bool active)
         if (sender() == m_shadeSelector) {
             m_colorTooltip->show(m_shadeSelector);
         } else {
-            m_colorTooltip->show(this);
+            m_colorTooltip->show(m_mainWidget);
         }
     }
 }
diff --git a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h
index 5a101ce67cf..126e8a5e702 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h
+++ b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h
@@ -110,6 +110,8 @@ private:
     ColorSpaceSource m_CSSource {LayerColorSpace};
     bool m_pendingFgUpdate {false};
     bool m_pendingBgUpdate {false};
+
+    QWidget* m_mainWidget;
 };
 
 namespace WGConfig {
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.