diff --git a/app/view/contextmenu.cpp b/app/view/contextmenu.cpp index 88aeaa7f8..f82d7388d 100644 --- a/app/view/contextmenu.cpp +++ b/app/view/contextmenu.cpp @@ -453,6 +453,8 @@ void ContextMenu::addAppletActions(QMenu *desktopMenu, Plasma::Applet *applet, Q return; } + desktopMenu->addSection(applet->pluginMetaData().name()); + for (QAction *action : applet->contextualActions()) { if (action) { desktopMenu->addAction(action); @@ -575,6 +577,10 @@ void ContextMenu::addContainmentActions(QMenu *desktopMenu, QEvent *event) } } + if (actions.count() > 0) { + desktopMenu->addSection(QString("Latte")); + } + desktopMenu->addActions(actions); return; diff --git a/containment/package/contents/ui/abilities/MyView.qml b/containment/package/contents/ui/abilities/MyView.qml index abbf87165..5b1977156 100644 --- a/containment/package/contents/ui/abilities/MyView.qml +++ b/containment/package/contents/ui/abilities/MyView.qml @@ -37,6 +37,9 @@ Ability.MyViewPrivate { isHidingBlocked: isHidingBlockedFromApplet || (view && view.contextMenuIsShown) + inEditMode: root.editMode + inConfigureAppletsMode: root.inConfigureAppletsMode + inSlidingIn: visibilityManager.inSlidingIn inSlidingOut: visibilityManager.inSlidingOut inRelocationAnimation: view && view.positioner && view.positioner.inRelocationAnimation diff --git a/declarativeimports/abilities/client/MyView.qml b/declarativeimports/abilities/client/MyView.qml index cca1543eb..ce2d55efe 100644 --- a/declarativeimports/abilities/client/MyView.qml +++ b/declarativeimports/abilities/client/MyView.qml @@ -36,6 +36,9 @@ AbilityDefinition.MyView { isShownFully: ref.myView.isShownFully isHidingBlocked: ref.myView.isHidingBlocked + inEditMode: ref.myView.inEditMode + inConfigureAppletsMode: ref.myView.inConfigureAppletsMode + inSlidingIn: ref.myView.inSlidingIn inSlidingOut: ref.myView.inSlidingOut inRelocationAnimation: ref.myView.inRelocationAnimation @@ -60,6 +63,8 @@ AbilityDefinition.MyView { readonly property AbilityDefinition.MyView local: AbilityDefinition.MyView { isShownFully: true + inEditMode: plasmoid.userConfiguring + inConfigureAppletsMode: plasmoid.userConfiguring } Item { diff --git a/declarativeimports/abilities/definition/MyView.qml b/declarativeimports/abilities/definition/MyView.qml index 9f7ea2cb4..f964c742a 100644 --- a/declarativeimports/abilities/definition/MyView.qml +++ b/declarativeimports/abilities/definition/MyView.qml @@ -36,6 +36,9 @@ Item { property bool isHidingBlocked: false + property bool inEditMode: false + property bool inConfigureAppletsMode: false + property bool inSlidingIn: false property bool inSlidingOut: false property bool inRelocationAnimation: false diff --git a/declarativeimports/abilities/host/MyView.qml b/declarativeimports/abilities/host/MyView.qml index db0bf5237..7252875a2 100644 --- a/declarativeimports/abilities/host/MyView.qml +++ b/declarativeimports/abilities/host/MyView.qml @@ -44,6 +44,9 @@ AbilityDefinition.MyView { readonly property alias isShownFully: apis.isShownFully readonly property alias isHidingBlocked: apis.isHidingBlocked + readonly property alias inEditMode: apis.inEditMode + readonly property alias inConfigureAppletsMode: apis.inConfigureAppletsMode + readonly property alias inSlidingIn: apis.inSlidingIn readonly property alias inSlidingOut: apis.inSlidingOut readonly property alias inRelocationAnimation: apis.inRelocationAnimation diff --git a/plasmoid/package/contents/ui/ContextMenu.qml b/plasmoid/package/contents/ui/ContextMenu.qml index ebf510abf..b9de0732a 100644 --- a/plasmoid/package/contents/ui/ContextMenu.qml +++ b/plasmoid/package/contents/ui/ContextMenu.qml @@ -868,6 +868,16 @@ PlasmaComponents.ContextMenu { } } + PlasmaComponents.MenuItem { + id: alternativesMenuItem + visible: (appletAbilities.myView.isReady && appletAbilities.myView.inEditMode) + || (!appletAbilities.myView.isReady && plasmoid.userConfiguring /*normal plasmoid in the desktop*/) + text: plasmoid.action("alternatives").text + icon: plasmoid.action("alternatives").icon + + onClicked: plasmoid.action("alternatives").trigger(); + } + PlasmaComponents.MenuItem { //text: i18n("Configure") //section: true @@ -909,15 +919,6 @@ PlasmaComponents.ContextMenu { visible: preferenceMenuItem.visible } - PlasmaComponents.MenuItem { - id: alternativesMenuItem - visible: root.inEditMode && !visualParent.isSeparator - text: plasmoid.action("alternatives").text - icon: plasmoid.action("alternatives").icon - - onClicked: plasmoid.action("alternatives").trigger(); - } - PlasmaComponents.MenuItem { id: addWidgets action: appletAbilities.myView.isReady ? appletAbilities.myView.action("add latte widgets") : plasmoid.action("configure"); @@ -967,7 +968,8 @@ PlasmaComponents.ContextMenu { PlasmaComponents.MenuItem { id: removePlasmoid - visible: (root.latteInEditMode) || (!root.latteBridge && !plasmoid.immutable /*normal plasmoid in the desktop*/) + visible: (appletAbilities.myView.isReady && appletAbilities.myView.inEditMode) + || (!root.latteBridge && !plasmoid.immutable /*normal plasmoid in the desktop*/) text: plasmoid.action("remove").text icon: plasmoid.action("remove").icon