context menus add more sections

--move elements around in order for the user to find
them at the same positions for all cases independent
if the user triggers context menu from applets or
empty containment areas
work/spdx
Michail Vourlakos 4 years ago
parent 995f61f08b
commit d51f2d99a3

@ -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;

@ -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

@ -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 {

@ -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

@ -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

@ -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

Loading…
Cancel
Save