Allow accepting reason dialogs with Ctrl+Enter
The original suggestion was the Enter key, but this won't work well as reasons can take multiple lines. I also made sure the reason control was focused by default, and that the "Cancel" button has an icon. BUG: 500990
This commit is contained in:
committed by
Tobias Fella
parent
c478a0c0fc
commit
7668da68d3
@@ -28,6 +28,14 @@ Kirigami.Page {
|
|||||||
placeholderText: root.placeholder
|
placeholderText: root.placeholder
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
|
focus: true
|
||||||
|
|
||||||
|
Keys.onReturnPressed: event => {
|
||||||
|
if (event.modifiers & Qt.ControlModifier) {
|
||||||
|
root.accepted(reason.text);
|
||||||
|
root.closeDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Kirigami.Theme.backgroundColor
|
color: Kirigami.Theme.backgroundColor
|
||||||
@@ -50,6 +58,7 @@ Kirigami.Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QQC2.Button {
|
QQC2.Button {
|
||||||
|
icon.name: "dialog-cancel-symbolic"
|
||||||
text: i18nc("@action", "Cancel")
|
text: i18nc("@action", "Cancel")
|
||||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
||||||
onClicked: root.closeDialog()
|
onClicked: root.closeDialog()
|
||||||
|
|||||||
Reference in New Issue
Block a user