Commit 965e07ce authored by Scott Petrovic's avatar Scott Petrovic

hide the brush editor if the application loses focus. also give the brush...

hide the brush editor if the application loses focus. also give the brush editor window a title to make its purpose a little more clear
parent 819da364
......@@ -431,6 +431,8 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider);
m_presetsPopup->parentWidget()->setWindowTitle(i18n("Brush Editor"));
connect(m_presetsPopup, SIGNAL(brushEditorShown()), SLOT(slotUpdateOptionsWidgetPopup()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_presetsPopup, SLOT(updateThemedIcons()));
......@@ -282,12 +282,25 @@ KisPaintOpPresetsPopup::KisPaintOpPresetsPopup(KisCanvasResourceProvider * resou
connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(slotFocusChanged(QWidget*,QWidget*)));
connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(slotApplicationStateChanged(Qt::ApplicationState)));
void KisPaintOpPresetsPopup::slotApplicationStateChanged(Qt::ApplicationState state)
// if the entire application loses focus, let's always hide the brush editor so it doesn't become a pest
// this situation get annoying especially if someone minimizes the application
// and the brush editor is still showing and won't disappear when clicking around the desktop
if (state == Qt::ApplicationInactive && parentWidget()) {
void KisPaintOpPresetsPopup::slotFocusChanged(QWidget* object1, QWidget* object2)
// object1 = "old" focus window. object2 = "active" focus window
......@@ -113,6 +113,7 @@ private Q_SLOTS:
void slotPinWindow(bool enabled);
void slotPaintOpChanged(int index);
void slotFocusChanged(QWidget* object1, QWidget* object2);
void slotApplicationStateChanged(Qt::ApplicationState);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment