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