Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/items/PlasmoidItem.qml
Show All 33 Lines | 24 | AbstractItem { | |||
---|---|---|---|---|---|
34 | subText: applet ? applet.toolTipSubText : "" | 34 | subText: applet ? applet.toolTipSubText : "" | ||
35 | icon: applet ? applet.icon : "" | 35 | icon: applet ? applet.icon : "" | ||
36 | mainItem: applet && applet.toolTipItem ? applet.toolTipItem : null | 36 | mainItem: applet && applet.toolTipItem ? applet.toolTipItem : null | ||
37 | textFormat: applet ? applet.toolTipTextFormat : "" | 37 | textFormat: applet ? applet.toolTipTextFormat : "" | ||
38 | status: applet ? applet.status : PlasmaCore.Types.UnknownStatus | 38 | status: applet ? applet.status : PlasmaCore.Types.UnknownStatus | ||
39 | active: root.activeApplet != applet | 39 | active: root.activeApplet != applet | ||
40 | 40 | | |||
41 | onClicked: { | 41 | onClicked: { | ||
42 | if (applet) { | 42 | if (applet && mouse.button == Qt.LeftButton) { | ||
43 | if (mouse.button == Qt.LeftButton) { | | |||
44 | applet.expanded = true; | 43 | applet.expanded = true; | ||
45 | } else if (mouse.button == Qt.RightButton) { | | |||
46 | plasmoid.nativeInterface.showPlasmoidMenu(applet, 0, plasmoidContainer.hidden ? applet.height : 0); | | |||
47 | } | 44 | } | ||
48 | } | 45 | } | ||
46 | onContextMenu: { | ||||
47 | if (applet) { | ||||
48 | plasmoid.nativeInterface.showPlasmoidMenu(applet, 0, plasmoidContainer.hidden ? applet.height : 0); | ||||
49 | } | ||||
49 | } | 50 | } | ||
51 | | ||||
50 | onHeightChanged: { | 52 | onHeightChanged: { | ||
51 | if (applet) { | 53 | if (applet) { | ||
52 | applet.width = height | 54 | applet.width = height | ||
53 | } | 55 | } | ||
54 | } | 56 | } | ||
55 | onAppletChanged: { | 57 | onAppletChanged: { | ||
56 | if (!applet) { | 58 | if (!applet) { | ||
57 | plasmoidContainer.destroy(); | 59 | plasmoidContainer.destroy(); | ||
Show All 24 Lines |