Warning, /plasma/plasma-desktop/desktoppackage/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 QQC2 0009 0010 0011 QQC2.Button { 0012 id: mouseInputButton 0013 property string defaultText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Action") 0014 text: defaultText 0015 checkable: true 0016 property string eventString 0017 0018 onCheckedChanged: { 0019 if (checked) { 0020 text = i18nd("plasma_shell_org.kde.plasma.desktop", "Input Here"); 0021 mouseInputArea.enabled = true; 0022 } 0023 } 0024 MouseArea { 0025 id: mouseInputArea 0026 anchors.fill: parent 0027 acceptedButtons: Qt.AllButtons 0028 enabled: false 0029 0030 onClicked: { 0031 var newEventString = configDialog.currentContainmentActionsModel.mouseEventString(mouse.button, mouse.modifiers); 0032 0033 if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) { 0034 eventString = newEventString; 0035 mouseInputButton.text = defaultText; 0036 mouseInputButton.checked = false; 0037 enabled = false; 0038 } 0039 } 0040 0041 onWheel: { 0042 var newEventString = configDialog.currentContainmentActionsModel.wheelEventString(wheel); 0043 0044 if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) { 0045 eventString = newEventString; 0046 mouseInputButton.text = defaultText; 0047 mouseInputButton.checked = false; 0048 enabled = false; 0049 } 0050 } 0051 } 0052 } 0053