Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
Context not available. | |||||
24 | AbstractItem { | 24 | AbstractItem { | ||
---|---|---|---|---|---|
25 | id: taskIcon | 25 | id: taskIcon | ||
26 | 26 | | |||
27 | itemId: Id | 27 | property var model | ||
28 | text: Title | 28 | | ||
29 | mainText: ToolTipTitle != "" ? ToolTipTitle : Title | 29 | itemId: model.Id | ||
30 | subText: ToolTipSubTitle | 30 | text: model.Title | ||
31 | icon: ToolTipIcon != "" ? ToolTipIcon : Icon ? Icon : IconName | 31 | mainText: model.ToolTipTitle !== "" ? model.ToolTipTitle : model.Title | ||
32 | subText: model.ToolTipSubTitle | ||||
33 | icon: model.ToolTipIcon !== "" ? model.ToolTipIcon : model.Icon ? model.Icon : model.IconName | ||||
32 | textFormat: Text.AutoText | 34 | textFormat: Text.AutoText | ||
33 | category: Category | 35 | category: model.Category | ||
34 | 36 | | |||
35 | status: { | 37 | status: { | ||
36 | switch (Status) { | 38 | switch (model.Status) { | ||
37 | case "Active": | 39 | case "Active": | ||
38 | return PlasmaCore.Types.ActiveStatus; | 40 | return PlasmaCore.Types.ActiveStatus; | ||
39 | case "NeedsAttention": | 41 | case "NeedsAttention": | ||
Context not available. | |||||
48 | 50 | | |||
49 | PlasmaCore.IconItem { | 51 | PlasmaCore.IconItem { | ||
50 | id: iconItem | 52 | id: iconItem | ||
51 | source: Icon ? Icon : IconName | 53 | source: model.Icon ? model.Icon : model.IconName | ||
52 | width: Math.min(parent.width, parent.height) | 54 | width: Math.min(parent.width, parent.height) | ||
53 | height: width | 55 | height: width | ||
54 | active: taskIcon.containsMouse | 56 | active: taskIcon.containsMouse | ||
Context not available. | |||||
67 | var pos = plasmoid.nativeInterface.popupPosition(taskIcon, mouse.x, mouse.y); | 69 | var pos = plasmoid.nativeInterface.popupPosition(taskIcon, mouse.x, mouse.y); | ||
68 | 70 | | |||
69 | switch (mouse.button) { | 71 | switch (mouse.button) { | ||
70 | case Qt.LeftButton: { | 72 | case Qt.LeftButton: | ||
71 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 73 | var service = plasmoid.nativeInterface.serviceForSource(model.DataEngineSource); | ||
72 | var operation = service.operationDescription("Activate"); | 74 | var operation = service.operationDescription("Activate"); | ||
73 | operation.x = pos.x; | 75 | operation.x = pos.x; | ||
74 | operation.y = pos.y; | 76 | operation.y = pos.y; | ||
Context not available. | |||||
81 | } | 83 | } | ||
82 | }); | 84 | }); | ||
83 | break; | 85 | break; | ||
84 | } | | |||
85 | case Qt.RightButton: | 86 | case Qt.RightButton: | ||
86 | openContextMenu(pos); | 87 | openContextMenu(pos); | ||
87 | break; | 88 | break; | ||
88 | 89 | | |||
89 | case Qt.MiddleButton: | 90 | case Qt.MiddleButton: | ||
90 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 91 | var service = plasmoid.nativeInterface.serviceForSource(model.DataEngineSource); | ||
91 | var operation = service.operationDescription("SecondaryActivate"); | 92 | var operation = service.operationDescription("SecondaryActivate"); | ||
92 | operation.x = pos.x; | 93 | operation.x = pos.x; | ||
93 | 94 | | |||
Context not available. | |||||
98 | } | 99 | } | ||
99 | 100 | | |||
100 | function openContextMenu(pos) { | 101 | function openContextMenu(pos) { | ||
101 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 102 | var service = plasmoid.nativeInterface.serviceForSource(model.DataEngineSource); | ||
102 | var operation = service.operationDescription("ContextMenu"); | 103 | var operation = service.operationDescription("ContextMenu"); | ||
103 | operation.x = pos.x; | 104 | operation.x = pos.x; | ||
104 | operation.y = pos.y; | 105 | operation.y = pos.y; | ||
Context not available. | |||||
112 | onWheel: { | 113 | onWheel: { | ||
113 | //don't send activateVertScroll with a delta of 0, some clients seem to break (kmix) | 114 | //don't send activateVertScroll with a delta of 0, some clients seem to break (kmix) | ||
114 | if (wheel.angleDelta.y !== 0) { | 115 | if (wheel.angleDelta.y !== 0) { | ||
115 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 116 | var service = plasmoid.nativeInterface.serviceForSource(model.DataEngineSource); | ||
116 | var operation = service.operationDescription("Scroll"); | 117 | var operation = service.operationDescription("Scroll"); | ||
117 | operation.delta =wheel.angleDelta.y; | 118 | operation.delta =wheel.angleDelta.y; | ||
118 | operation.direction = "Vertical"; | 119 | operation.direction = "Vertical"; | ||
119 | service.startOperationCall(operation); | 120 | service.startOperationCall(operation); | ||
120 | } | 121 | } | ||
121 | if (wheel.angleDelta.x !== 0) { | 122 | if (wheel.angleDelta.x !== 0) { | ||
122 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 123 | var service = plasmoid.nativeInterface.serviceForSource(model.DataEngineSource); | ||
123 | var operation = service.operationDescription("Scroll"); | 124 | var operation = service.operationDescription("Scroll"); | ||
124 | operation.delta =wheel.angleDelta.x; | 125 | operation.delta =wheel.angleDelta.x; | ||
125 | operation.direction = "Horizontal"; | 126 | operation.direction = "Horizontal"; | ||
Context not available. |