Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/SideBarItem.qml
Show All 31 Lines | 27 | Item { | |||
---|---|---|---|---|---|
32 | 32 | | |||
33 | signal actionTriggered(string actionId, variant actionArgument) | 33 | signal actionTriggered(string actionId, variant actionArgument) | ||
34 | signal aboutToShowActionMenu(variant actionMenu) | 34 | signal aboutToShowActionMenu(variant actionMenu) | ||
35 | 35 | | |||
36 | property bool hasActionList: ((model.favoriteId !== null) | 36 | property bool hasActionList: ((model.favoriteId !== null) | ||
37 | || (("hasActionList" in model) && (model.hasActionList !== null))) | 37 | || (("hasActionList" in model) && (model.hasActionList !== null))) | ||
38 | property int itemIndex: model.index | 38 | property int itemIndex: model.index | ||
39 | 39 | | |||
40 | onAboutToShowActionMenu: { | 40 | onAboutToShowActionMenu: actionMenu => { | ||
41 | var actionList = (model.hasActionList !== null) ? model.actionList : []; | 41 | var actionList = (model.hasActionList !== null) ? model.actionList : []; | ||
42 | Tools.fillActionMenu(i18n, actionMenu, actionList, repeater.model, model.favoriteId); | 42 | Tools.fillActionMenu(i18n, actionMenu, actionList, repeater.model, model.favoriteId); | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | onActionTriggered: { | 45 | onActionTriggered: (actionId, actionArgument) => { | ||
46 | if (Tools.triggerAction(repeater.model, model.index, actionId, actionArgument) === true) { | 46 | if (Tools.triggerAction(repeater.model, model.index, actionId, actionArgument) === true) { | ||
47 | plasmoid.expanded = false; | 47 | plasmoid.expanded = false; | ||
48 | } | 48 | } | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | function openActionMenu(visualParent, x, y) { | 51 | function openActionMenu(visualParent, x, y) { | ||
52 | aboutToShowActionMenu(actionMenu); | 52 | aboutToShowActionMenu(actionMenu); | ||
53 | actionMenu.visualParent = visualParent; | 53 | actionMenu.visualParent = visualParent; | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |