1
mirror of https://github.com/monero-project/monero-gui synced 2024-11-22 12:14:00 +01:00

RemoteNodeDialog: bind ok to return key

This commit binds the enter / return key on the remote
node dialog. If cursor is in the host, port or password
input fields the keyboard can be used to continue. It is not
bound to the username field because ideally a user would
enter password or port last.
This commit is contained in:
reemuru 2022-03-12 21:33:34 -05:00
parent fd8983a7ff
commit de81af0e8d
No known key found for this signature in database
GPG Key ID: 5EDBFEFFA9E9A7AB

View File

@ -42,6 +42,13 @@ MoneroComponents.Dialog {
onActiveFocusChanged: activeFocus && remoteNodeAddress.forceActiveFocus()
function onOk() {
root.success = true;
root.close();
}
function onCancel() { root.close(); }
function add(callbackOnSuccess) {
root.editMode = false;
root.callbackOnSuccess = callbackOnSuccess;
@ -89,6 +96,11 @@ MoneroComponents.Dialog {
daemonAddrLabelText: qsTr("Address") + translationManager.emptyString
daemonPortLabelText: qsTr("Port") + translationManager.emptyString
Keys.enabled: root.visible
Keys.onEnterPressed: root.onOk()
Keys.onReturnPressed: root.onOk()
Keys.onEscapePressed: root.onCancel()
}
RowLayout {
@ -116,6 +128,11 @@ MoneroComponents.Dialog {
placeholderFontSize: 15
labelFontSize: 14
fontSize: 15
Keys.enabled: root.visible
Keys.onEnterPressed: root.onOk()
Keys.onReturnPressed: root.onOk()
Keys.onEscapePressed: root.onCancel()
}
}