Warning, /plasma/plasma-sdk/plasmoidviewer/qmlpackages/shell/contents/configuration/MouseEventInputButton.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.0
0008 import QtQuick.Controls 2.3 as QtControls
0009 import QtQuick.Layouts 1.0
0010 
0011 
0012 QtControls.Button {
0013     id: mouseInputButton
0014     property string defaultText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Action")
0015     text: defaultText
0016     checkable: true
0017     property string eventString
0018 
0019     onCheckedChanged: {
0020         if (checked) {
0021             text = i18nd("plasma_shell_org.kde.plasma.desktop", "Input Here");
0022             mouseInputArea.enabled = true;
0023         }
0024     }
0025     MouseArea {
0026         id: mouseInputArea
0027         anchors.fill: parent
0028         acceptedButtons: Qt.AllButtons
0029         enabled: false
0030 
0031         onClicked: {
0032             var newEventString = configDialog.currentContainmentActionsModel.mouseEventString(mouse.button, mouse.modifiers);
0033 
0034             if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) {
0035                 eventString = newEventString;
0036                 mouseInputButton.text = defaultText;
0037                 mouseInputButton.checked = false;
0038                 enabled = false;
0039             }
0040         }
0041 
0042         onWheel: {
0043             var newEventString = configDialog.currentContainmentActionsModel.wheelEventString(wheel.pixelDelta, wheel.buttons, wheel.modifiers);
0044 
0045             if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) {
0046                 eventString = newEventString;
0047                 mouseInputButton.text = defaultText;
0048                 mouseInputButton.checked = false;
0049                 enabled = false;
0050             }
0051         }
0052     }
0053 }
0054