Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/Task.qml
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 31 | MouseArea { | |||
---|---|---|---|---|---|
121 | } | 121 | } | ||
122 | 122 | | |||
123 | onPressed: { | 123 | onPressed: { | ||
124 | if (mouse.button == Qt.LeftButton || mouse.button == Qt.MidButton) { | 124 | if (mouse.button == Qt.LeftButton || mouse.button == Qt.MidButton) { | ||
125 | pressed = true; | 125 | pressed = true; | ||
126 | pressX = mouse.x; | 126 | pressX = mouse.x; | ||
127 | pressY = mouse.y; | 127 | pressY = mouse.y; | ||
128 | } else if (mouse.button == Qt.RightButton) { | 128 | } else if (mouse.button == Qt.RightButton) { | ||
129 | tasks.createContextMenu(task, modelIndex()).show(); | 129 | // When we're a launcher, there's no window controls, so we can show all | ||
130 | // places without the menu getting super huge. | ||||
131 | if (model.IsLauncher === true) { | ||||
132 | showContextMenu({showAllPlaces: true}) | ||||
133 | } else { | ||||
134 | showContextMenu(); | ||||
135 | } | ||||
130 | } | 136 | } | ||
131 | } | 137 | } | ||
132 | 138 | | |||
133 | onReleased: { | 139 | onReleased: { | ||
134 | if (pressed) { | 140 | if (pressed) { | ||
135 | if (mouse.button == Qt.MidButton) { | 141 | if (mouse.button == Qt.MidButton) { | ||
136 | if (plasmoid.configuration.middleClickAction == TaskManagerApplet.Backend.NewInstance) { | 142 | if (plasmoid.configuration.middleClickAction == TaskManagerApplet.Backend.NewInstance) { | ||
137 | tasksModel.requestNewInstance(modelIndex()); | 143 | tasksModel.requestNewInstance(modelIndex()); | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
195 | Keys.onReturnPressed: TaskTools.activateTask(modelIndex(), model, event.modifiers, task) | 201 | Keys.onReturnPressed: TaskTools.activateTask(modelIndex(), model, event.modifiers, task) | ||
196 | Keys.onEnterPressed: Keys.onReturnPressed(event); | 202 | Keys.onEnterPressed: Keys.onReturnPressed(event); | ||
197 | 203 | | |||
198 | function modelIndex() { | 204 | function modelIndex() { | ||
199 | return (inPopup ? tasksModel.makeModelIndex(groupDialog.visualParent.itemIndex, index) | 205 | return (inPopup ? tasksModel.makeModelIndex(groupDialog.visualParent.itemIndex, index) | ||
200 | : tasksModel.makeModelIndex(index)); | 206 | : tasksModel.makeModelIndex(index)); | ||
201 | } | 207 | } | ||
202 | 208 | | |||
209 | function showContextMenu(args) { | ||||
210 | tasks.createContextMenu(task, modelIndex(), args).show(); | ||||
211 | } | ||||
212 | | ||||
203 | function updateAudioStreams() { | 213 | function updateAudioStreams() { | ||
204 | var pa = pulseAudio.item; | 214 | var pa = pulseAudio.item; | ||
205 | if (!pa) { | 215 | if (!pa) { | ||
206 | task.audioStreams = []; | 216 | task.audioStreams = []; | ||
207 | return; | 217 | return; | ||
208 | } | 218 | } | ||
209 | 219 | | |||
210 | var streams = pa.streamsForPid(task.pid); | 220 | var streams = pa.streamsForPid(task.pid); | ||
▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines |