From 7668da68d3a9db1389fe9b5c9148525828c8a032 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 1 Jun 2025 08:30:39 +0200 Subject: [PATCH] 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 --- src/app/qml/ReasonDialog.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/qml/ReasonDialog.qml b/src/app/qml/ReasonDialog.qml index 7c346cbef..f4cd65471 100644 --- a/src/app/qml/ReasonDialog.qml +++ b/src/app/qml/ReasonDialog.qml @@ -28,6 +28,14 @@ Kirigami.Page { placeholderText: root.placeholder anchors.fill: parent wrapMode: TextEdit.Wrap + focus: true + + Keys.onReturnPressed: event => { + if (event.modifiers & Qt.ControlModifier) { + root.accepted(reason.text); + root.closeDialog(); + } + } background: Rectangle { color: Kirigami.Theme.backgroundColor @@ -50,6 +58,7 @@ Kirigami.Page { } } QQC2.Button { + icon.name: "dialog-cancel-symbolic" text: i18nc("@action", "Cancel") QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole onClicked: root.closeDialog()