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
wilder-5.25
Aleix Pol Gonzalez 4 years ago committed by Nate Graham
parent a7588366e6
commit a667b99dee
  1. 11
      components/dialogs/SystemDialog.qml

@ -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()
}
}

Loading…
Cancel
Save