[graphics/krita/krita/6.0] 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 3cf116c849590c05b7aa5eb5983f50a385b38e65 by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 27/07/2026 at 12:15.
Pushed by dkazakov into branch 'krita/6.0'.

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/3cf116c849590c05b7aa5eb5983f50a385b38e65

diff --git a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
index a723bfb6d71..b034db6b282 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
+++ b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.cpp
@@ -44,10 +44,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);
@@ -420,7 +421,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 423c1a2236b..f77f46916fd 100644
--- a/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h
+++ b/plugins/dockers/widegamutcolorselector/WGColorSelectorDock.h
@@ -107,6 +107,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.