Commit b1577e10 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


(cherry picked from commit a667b99d)
parent 0848ba21
Pipeline #143522 passed with stage
in 11 minutes and 21 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) {
root.accept()
}
}
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