Commit a667b99d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Nate Graham
Browse files

SystemDialog: Allow accepting the dialogs with the keyboard

If there's an enabled Ok button, it will accept the dialog when Enter is
pressed as it reaches the dialog.

BUG: 450223
FIXED-IN: 5.24.3
parent a7588366
Pipeline #143519 passed with stage
in 15 minutes and 44 seconds
......@@ -123,7 +123,16 @@ Kirigami.AbstractApplicationWindow {
Keys.onEscapePressed: root.reject()
focus: true
function accept() {
const button = dialogButtonBox.standardButton(DialogButtonBox.Ok);
if (button && button.enabled) {
Keys.onEnterPressed: accept()
Keys.onReturnPressed: accept()
Keys.onEscapePressed: root.reject()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment