diff --git a/app/gui/NavigableMessageDialog.qml b/app/gui/NavigableMessageDialog.qml index e9e35d46..cc80c1ed 100644 --- a/app/gui/NavigableMessageDialog.qml +++ b/app/gui/NavigableMessageDialog.qml @@ -15,7 +15,9 @@ NavigableDialog { onOpened: { // Force keyboard focus on the label so keyboard navigation works - dialogLabel.forceActiveFocus() + if (dialogButtonBox.count > 0) { + dialogButtonBox.itemAt(dialogButtonBox.count - 1).forceActiveFocus(Qt.TabFocus) + } } RowLayout { @@ -52,18 +54,6 @@ NavigableDialog { // will cause word wrap to kick in. Layout.maximumWidth: 400 Layout.maximumHeight: 400 - - Keys.onReturnPressed: { - accept() - } - - Keys.onEnterPressed: { - accept() - } - - Keys.onEscapePressed: { - reject() - } } } @@ -71,6 +61,15 @@ NavigableDialog { id: dialogButtonBox standardButtons: dialog.standardButtons + delegate: Button { + flat: true + + Keys.onReturnPressed: clicked() + Keys.onEnterPressed: clicked() + Keys.onRightPressed: nextItemInFocusChain(true).forceActiveFocus(Qt.TabFocus) + Keys.onLeftPressed: nextItemInFocusChain(false).forceActiveFocus(Qt.TabFocus) + } + onHelpRequested: { Qt.openUrlExternally(helpUrl) close()