aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorreemuru <rimuru@hiahatf.org>2022-03-12 21:33:34 -0500
committerreemuru <rimuru@hiahatf.org>2022-03-13 15:02:11 -0400
commitde81af0e8d8de530bfb3fc0b974bdabf11c9189f (patch)
treef89bb27b31ea9b303e42e1d21520277cc3970ffa /components
parentfd8983a7ffe9e6825563243d01469898d1d30b45 (diff)
downloadmonzero-gui-de81af0e8d8de530bfb3fc0b974bdabf11c9189f.tar.gz
monzero-gui-de81af0e8d8de530bfb3fc0b974bdabf11c9189f.tar.xz
monzero-gui-de81af0e8d8de530bfb3fc0b974bdabf11c9189f.zip
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.
Diffstat (limited to 'components')
-rw-r--r--components/RemoteNodeDialog.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/components/RemoteNodeDialog.qml b/components/RemoteNodeDialog.qml
index 30383d44..a940feef 100644
--- a/components/RemoteNodeDialog.qml
+++ b/components/RemoteNodeDialog.qml
@@ -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()
}
}