diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 2e899531c..c446c2f88 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -407,6 +407,7 @@ void Containment::addApplet(Applet *applet) emit currentContainment->appletRemoved(applet); disconnect(applet, nullptr, currentContainment, nullptr); + connect(currentContainment, nullptr, applet, nullptr); KConfigGroup oldConfig = applet->config(); currentContainment->d->applets.removeAll(applet); applet->setParent(this); @@ -449,6 +450,7 @@ void Containment::addApplet(Applet *applet) connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*))); connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus))); connect(applet, &Applet::activated, this, &Applet::activated); + connect(this, &Containment::containmentDisplayHintsChanged, applet, &Applet::containmentDisplayHintsChanged); if (!currentContainment) { const bool isNew = applet->d->mainConfigGroup()->entryMap().isEmpty(); diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 78ea7e41d..badb3ad8b 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -872,6 +872,12 @@ QList ContainmentInterface::actions() const return actionList; } +void ContainmentInterface::setContainmentDisplayHints(Plasma::Types::ContainmentDisplayHints hints) +{ + m_containment->setContainmentDisplayHints(hints); +} + + //PROTECTED-------------------- void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.h b/src/scriptengines/qml/plasmoid/containmentinterface.h index 97ab02ca7..e891a2e99 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.h +++ b/src/scriptengines/qml/plasmoid/containmentinterface.h @@ -75,6 +75,8 @@ class ContainmentInterface : public AppletInterface */ Q_PROPERTY(bool editMode READ isEditMode WRITE setEditMode NOTIFY editModeChanged) + Q_PROPERTY(Plasma::Types::ContainmentDisplayHints containmentDisplayHints READ containmentDisplayHints WRITE setContainmentDisplayHints NOTIFY containmentDisplayHintsChanged) + public: ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args = QVariantList()); @@ -100,6 +102,8 @@ public: QList actions() const; + void setContainmentDisplayHints(Plasma::Types::ContainmentDisplayHints hints); + /** * Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button */