use the componentized button for input
This commit is contained in:
parent
6617a26726
commit
8052ed8566
@ -93,39 +93,11 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QtControls.Button {
|
MouseEventInputButton {
|
||||||
id: mouseInputButton
|
defaultText: i18n("Add Action");
|
||||||
text: i18n("Add Action")
|
onEventStringChanged: {
|
||||||
checkable: true
|
configDialog.currentContainmentActionsModel.append(eventString, "org.kde.contextmenu");
|
||||||
onCheckedChanged: {
|
|
||||||
if (checked) {
|
|
||||||
text = i18n("Input Here");
|
|
||||||
mouseInputArea.enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: mouseInputArea
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.AllButtons
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
if (configDialog.currentContainmentActionsModel.append(configDialog.currentContainmentActionsModel.mouseEventString(mouse.button, mouse.modifiers), "org.kde.contextmenu")) {
|
|
||||||
mouseInputButton.text = i18n("Add Action");
|
|
||||||
mouseInputButton.checked = false;
|
|
||||||
enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onWheel: {
|
|
||||||
if (configDialog.currentContainmentActionsModel.append(configDialog.currentContainmentActionsModel.wheelEventString(wheel.pixelDelta, wheel.buttons, wheel.modifiers), "org.kde.contextmenu")) {
|
|
||||||
mouseInputButton.text = i18n("Add Action");
|
|
||||||
mouseInputButton.checked = false;
|
|
||||||
enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user