Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/ToolTipWindowMouseArea.qml
Context not available. | |||||
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 thumbnailItem | 29 | property Item rootTask | ||
30 | 30 | | |||
31 | acceptedButtons: Qt.LeftButton | 31 | acceptedButtons: Qt.LeftButton | Qt.RightButton | ||
32 | hoverEnabled: true | 32 | hoverEnabled: true | ||
33 | enabled: winId != 0 | 33 | enabled: winId != 0 | ||
34 | 34 | | |||
35 | onClicked: { | 35 | onClicked: { | ||
36 | tasksModel.requestActivate(modelIndex); | 36 | if (mouse.button == Qt.LeftButton) { | ||
37 | toolTip.hideToolTip(); | 37 | tasksModel.requestActivate(modelIndex); | ||
38 | } else { | ||||
39 | tasks.createContextMenu(rootTask, modelIndex).show(); | ||||
40 | } | ||||
41 | toolTipLoader.item.hideToolTip(); | ||||
38 | } | 42 | } | ||
39 | 43 | | |||
40 | onContainsMouseChanged: { | 44 | onContainsMouseChanged: { | ||
41 | tasks.windowsHovered([winId], containsMouse); | 45 | tasks.windowsHovered([winId], containsMouse); | ||
42 | } | 46 | } | ||
43 | | ||||
44 | PlasmaComponents.ToolButton { | | |||
45 | anchors { | | |||
46 | top: parent.top | | |||
47 | topMargin: thumbnailItem ? (thumbnailItem.height - thumbnailItem.paintedHeight) / 2 : 0 | | |||
48 | right: parent.right | | |||
49 | rightMargin: thumbnailItem ? (thumbnailItem.width - thumbnailItem.paintedWidth) / 2 : 0 | | |||
50 | } | | |||
51 | | ||||
52 | iconSource: "window-close" | | |||
53 | visible: parent.containsMouse && winId != 0 | | |||
54 | tooltip: i18nc("close this window", "Close") | | |||
55 | | ||||
56 | onClicked: { | | |||
57 | backend.cancelHighlightWindows(); | | |||
58 | tasksModel.requestClose(modelIndex); | | |||
59 | } | | |||
60 | } | | |||
61 | } | 47 | } | ||
Context not available. |