Commit 1640a45b authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

krita: Enable floating messages for Gemini and disable them properly for sketch

parent 0d126f4f
......@@ -329,6 +329,7 @@ void KisSketchView::documentChanged()
Q_ASSERT(part);
QPointer<KisView2> view = qobject_cast<KisView2*>(part->createView(d->doc, QApplication::activeWindow()));
d->view = view;
d->view->setShowFloatingMessage(false);
connect(d->view, SIGNAL(floatingMessageRequested(QString,QString)), this, SIGNAL(floatingMessageRequested(QString,QString)));
......
......@@ -172,6 +172,7 @@ public:
, actionManager(0)
, mainWindow(0)
, tooltipManager(0)
, showFloatingMessage(true)
{
}
......@@ -228,6 +229,7 @@ public:
KisMirrorAxis* mirrorAxis;
KisTooltipManager* tooltipManager;
QPointer<KisFloatingMessage> savedFloatingMessage;
bool showFloatingMessage;
};
......@@ -1602,12 +1604,11 @@ void KisView2::updateIcons()
void KisView2::showFloatingMessage(const QString message, const QIcon& icon, int timeout, KisFloatingMessage::Priority priority)
{
// Yes, the @return is correct. But only for widget based KDE apps, not QML based ones
if (mainWindow()) {
if(m_d->showFloatingMessage) {
if (m_d->savedFloatingMessage) {
m_d->savedFloatingMessage->tryOverrideMessage(message, icon, timeout, priority);
} else {
m_d->savedFloatingMessage = new KisFloatingMessage(message, mainWindow()->centralWidget(), false, timeout, priority);
m_d->savedFloatingMessage = new KisFloatingMessage(message, qtMainWindow()->centralWidget(), false, timeout, priority);
m_d->savedFloatingMessage->setShowOverParent(true);
m_d->savedFloatingMessage->setIcon(icon);
m_d->savedFloatingMessage->showMessage();
......@@ -1632,4 +1633,9 @@ void KisView2::showHideScrollbars()
}
}
void KisView2::setShowFloatingMessage(bool show)
{
m_d->showFloatingMessage = show;
}
#include "kis_view2.moc"
......@@ -199,6 +199,7 @@ public slots:
void slotLoadingFinished();
void slotSavingFinished();
void showJustTheCanvas(bool toggled);
void setShowFloatingMessage(bool show);
signals:
......
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