show/hide view when applet asked to be destroyed
Change-Id: Id53300532c2322467188dbb44259f25dc6183a1e
This commit is contained in:
parent
72b9a37fe9
commit
280902bbb5
@ -44,6 +44,7 @@ public:
|
|||||||
Plasma::Types::FormFactor formFactor() const;
|
Plasma::Types::FormFactor formFactor() const;
|
||||||
Plasma::Types::Location location() const;
|
Plasma::Types::Location location() const;
|
||||||
void showConfigurationInterface(Plasma::Applet *applet);
|
void showConfigurationInterface(Plasma::Applet *applet);
|
||||||
|
void updateDestroyed(bool destroyed);
|
||||||
|
|
||||||
View *q;
|
View *q;
|
||||||
friend class View;
|
friend class View;
|
||||||
@ -102,6 +103,9 @@ void ViewPrivate::setContainment(Plasma::Containment *cont)
|
|||||||
q, &View::formFactorChanged);
|
q, &View::formFactorChanged);
|
||||||
QObject::connect(cont, &Plasma::Containment::configureRequested,
|
QObject::connect(cont, &Plasma::Containment::configureRequested,
|
||||||
q, &View::showConfigurationInterface);
|
q, &View::showConfigurationInterface);
|
||||||
|
QObject::connect(cont, SIGNAL(destroyedChanged(bool)),
|
||||||
|
q, SLOT(updateDestroyed(bool)));
|
||||||
|
q->setVisible(!cont->destroyed() && cont->isUiReady());
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -162,6 +166,11 @@ void ViewPrivate::showConfigurationInterface(Plasma::Applet *applet)
|
|||||||
configView->show();
|
configView->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ViewPrivate::updateDestroyed(bool destroyed)
|
||||||
|
{
|
||||||
|
q->setVisible(!destroyed);
|
||||||
|
}
|
||||||
|
|
||||||
View::View(Plasma::Corona *corona, QWindow *parent)
|
View::View(Plasma::Corona *corona, QWindow *parent)
|
||||||
: QQuickView(parent),
|
: QQuickView(parent),
|
||||||
d(new ViewPrivate(corona, this))
|
d(new ViewPrivate(corona, this))
|
||||||
|
@ -127,6 +127,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ViewPrivate *const d;
|
ViewPrivate *const d;
|
||||||
|
Q_PRIVATE_SLOT(d, void updateDestroyed(bool))
|
||||||
friend class ViewPrivate;
|
friend class ViewPrivate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user