[graphics/krita] libs/ui: Make the preset editor a dialog
Halla Rempt
null at kde.org
Tue Mar 16 12:20:29 GMT 2021
Git commit 8a0432a8b6e2e79505032175821a58ddc20a94f7 by Halla Rempt.
Committed on 16/03/2021 at 12:17.
Pushed by rempt into branch 'master'.
Make the preset editor a dialog
(for now, this makes debugging easier on X11.)
CCMAIL:kimageshop at kde.org
M +5 -7 libs/ui/kis_paintop_box.cc
M +1 -1 libs/ui/widgets/kis_paintop_presets_popup.cpp
https://invent.kde.org/graphics/krita/commit/8a0432a8b6e2e79505032175821a58ddc20a94f7
diff --git a/libs/ui/kis_paintop_box.cc b/libs/ui/kis_paintop_box.cc
index 2a5cae17f8..04bf01f4b4 100644
--- a/libs/ui/kis_paintop_box.cc
+++ b/libs/ui/kis_paintop_box.cc
@@ -106,7 +106,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
m_favoriteResourceManager = new KisFavoriteResourceManager(this);
-
KConfigGroup grp = KSharedConfig::openConfig()->group("krita").group("Toolbar BrushesAndStuff");
int iconsize = grp.readEntry("IconSize", 22);
// NOTE: buttonsize should be the same value as the one used in ktoolbar for all QToolButton
@@ -192,8 +191,6 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
moveToCenterActionY = m_viewManager->actionManager()->createAction("mirrorY-moveToCenter");
toolbarMenuYMirror->addAction(moveToCenterActionY);
-
-
// create horizontal and vertical mirror buttons
m_hMirrorButton = new KisHighlightedToolButton(this);
@@ -450,11 +447,11 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
m_savePresetWidget = new KisPresetSaveWidget(this);
- m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider, m_favoriteResourceManager, m_savePresetWidget);
- m_brushEditorPopupButton->setPopupWidget(m_presetsPopup);
- m_presetsPopup->parentWidget()->setWindowTitle(i18n("Brush Editor"));
-
+ m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider, m_favoriteResourceManager, m_savePresetWidget, m_brushEditorPopupButton);
+ m_presetsPopup->hide();
+ m_presetsPopup->setWindowTitle(i18n("Brush Editor"));
+ connect(m_brushEditorPopupButton, SIGNAL(clicked(bool)), m_presetsPopup, SLOT(show()));
connect(m_presetsPopup, SIGNAL(brushEditorShown()), SLOT(slotUpdateOptionsWidgetPopup()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_presetsPopup, SLOT(updateThemedIcons()));
@@ -522,6 +519,7 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
connect(m_resourceProvider, SIGNAL(sigFGColorChanged(KoColor)), m_favoriteResourceManager, SLOT(slotChangeFGColorSelector(KoColor)));
connect(m_resourceProvider, SIGNAL(sigBGColorChanged(KoColor)), m_favoriteResourceManager, SLOT(slotSetBGColor(KoColor)));
+
// cold initialization
m_favoriteResourceManager->slotChangeFGColorSelector(m_resourceProvider->fgColor());
m_favoriteResourceManager->slotSetBGColor(m_resourceProvider->bgColor());
diff --git a/libs/ui/widgets/kis_paintop_presets_popup.cpp b/libs/ui/widgets/kis_paintop_presets_popup.cpp
index 0d0e6b614d..dbe27410fb 100644
--- a/libs/ui/widgets/kis_paintop_presets_popup.cpp
+++ b/libs/ui/widgets/kis_paintop_presets_popup.cpp
@@ -73,7 +73,7 @@ KisPaintOpPresetsPopup::KisPaintOpPresetsPopup(KisCanvasResourceProvider * resou
KisFavoriteResourceManager* favoriteResourceManager,
KisPresetSaveWidget* savePresetWidget,
QWidget * parent)
- : QWidget(parent)
+ : QWidget(parent, Qt::Dialog)
, m_d(new Private())
{
setObjectName("KisPaintOpPresetsPopup");
More information about the kimageshop
mailing list