summary refs log tree commit diff
path: root/resources/qml/dialogs
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-10-05 19:53:39 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-10-09 17:14:35 -0400
commit484845c130d1277294ac9ae3c3c9ebeefd437553 (patch)
tree23ace241020c3973bb454839b65b336c168b1b96 /resources/qml/dialogs
parentQML the join room dialog (diff)
downloadnheko-484845c130d1277294ac9ae3c3c9ebeefd437553.tar.xz
Add handy keyboard shortcuts
Diffstat (limited to 'resources/qml/dialogs')
-rw-r--r--resources/qml/dialogs/JoinRoomDialog.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/resources/qml/dialogs/JoinRoomDialog.qml b/resources/qml/dialogs/JoinRoomDialog.qml
index 25400e40..2554215d 100644
--- a/resources/qml/dialogs/JoinRoomDialog.qml
+++ b/resources/qml/dialogs/JoinRoomDialog.qml
@@ -20,6 +20,19 @@ ApplicationWindow {
     width: 350
     height: fontMetrics.lineSpacing * 7
 
+    Shortcut {
+        sequence: "Return"
+        onActivated: {
+            if (input.text.match("#.+?:.{3,}"))
+                dbb.accepted();
+        }
+    }
+
+    Shortcut {
+        sequence: StandardKey.Cancel
+        onActivated: dbb.rejected()
+    }
+
     ColumnLayout {
         spacing: Nheko.paddingMedium
         anchors.margins: Nheko.paddingMedium
@@ -41,6 +54,8 @@ ApplicationWindow {
     }
 
     footer: DialogButtonBox {
+        id: dbb
+
         onAccepted: {
             Nheko.joinRoom(input.text);
             joinRoomRoot.close();