Warning, /plasma/plasma-desktop/applets/taskmanager/package/contents/ui/ToolTipWindowMouseArea.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2013 Sebastian Kügler <sebas@kde.org>
0003     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0004     SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 import QtQuick
0010 
0011 MouseArea {
0012     property var modelIndex
0013     // winId won't be an int wayland
0014     property var winId // FIXME Legacy
0015     property Item rootTask
0016 
0017     acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
0018     hoverEnabled: true
0019     enabled: winId !== 0
0020 
0021     onClicked: (mouse) => {
0022         switch (mouse.button) {
0023         case Qt.LeftButton:
0024             tasksModel.requestActivate(modelIndex);
0025             rootTask.hideImmediately();
0026             backend.cancelHighlightWindows();
0027             break;
0028         case Qt.MiddleButton:
0029             backend.cancelHighlightWindows();
0030             tasksModel.requestClose(modelIndex);
0031             break;
0032         case Qt.RightButton:
0033             tasks.createContextMenu(rootTask, modelIndex).show();
0034             break;
0035         }
0036     }
0037 
0038     onContainsMouseChanged: {
0039         tasks.windowsHovered([winId], containsMouse);
0040     }
0041 }