Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/ToolTipWindowMouseArea.qml
Show All 22 Lines | |||||
23 | 23 | | |||
24 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
25 | 25 | | |||
26 | MouseArea { | 26 | MouseArea { | ||
27 | property var modelIndex | 27 | property var modelIndex | ||
28 | property int winId // FIXME Legacy | 28 | property int winId // FIXME Legacy | ||
29 | property Item rootTask | 29 | property Item rootTask | ||
30 | 30 | | |||
31 | acceptedButtons: Qt.LeftButton | Qt.RightButton | 31 | acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton | ||
32 | hoverEnabled: true | 32 | hoverEnabled: true | ||
33 | enabled: winId != 0 | 33 | enabled: winId != 0 | ||
34 | 34 | | |||
35 | onClicked: { | 35 | onClicked: { | ||
36 | if (mouse.button == Qt.LeftButton) { | 36 | if (mouse.button == Qt.LeftButton) { | ||
37 | tasksModel.requestActivate(modelIndex); | 37 | tasksModel.requestActivate(modelIndex); | ||
38 | } else { | 38 | rootTask.hideToolTipTemporarily(); | ||
39 | } else if (mouse.button == Qt.MiddleButton) { | ||||
40 | backend.cancelHighlightWindows(); | ||||
41 | tasksModel.requestClose(modelIndex); | ||||
42 | } else /* right button */ { | ||||
39 | tasks.createContextMenu(rootTask, modelIndex).show(); | 43 | tasks.createContextMenu(rootTask, modelIndex).show(); | ||
40 | } | 44 | } | ||
41 | rootTask.hideToolTipTemporarily(); | | |||
42 | } | 45 | } | ||
43 | 46 | | |||
44 | onContainsMouseChanged: { | 47 | onContainsMouseChanged: { | ||
45 | tasks.windowsHovered([winId], containsMouse); | 48 | tasks.windowsHovered([winId], containsMouse); | ||
46 | } | 49 | } | ||
47 | } | 50 | } |