fix #285,expanded to false for applets

--when changing session all the applets from
the previous session should hide their
expanded options
v0.6
Michail Vourlakos 8 years ago
parent 989629134c
commit 8a1c449396

@ -511,6 +511,7 @@ void DockCorona::syncDockViews()
if (view->session() != currentSession()) {
qDebug() << "deleting view that does not belong in this session...";
auto viewToDelete = m_dockViews.take(view->containment());
viewToDelete->deactivateApplets();
viewToDelete->deleteLater();
//! which explicit docks can be deleted
} else if (!found && !view->onPrimary() && (m_dockViews.size() > 1) && m_dockViews.contains(view->containment())

@ -1066,6 +1066,21 @@ void DockView::closeApplication()
dockCorona->closeApplication();
}
void DockView::deactivateApplets()
{
if (!containment()) {
return;
}
foreach (auto applet, containment()->applets()) {
PlasmaQuick::AppletQuickItem *ai = applet->property("_plasma_graphicObject").value<PlasmaQuick::AppletQuickItem *>();
if (ai) {
ai->setExpanded(false);
}
}
}
QVariantList DockView::containmentActions()
{
QVariantList actions;

@ -139,6 +139,8 @@ public:
VisibilityManager *visibility() const;
void deactivateApplets();
QQmlListProperty<QScreen> screens();
static int countScreens(QQmlListProperty<QScreen> *property);
static QScreen *atScreens(QQmlListProperty<QScreen> *property, int index);

Loading…
Cancel
Save