summary refs log tree commit diff
path: root/resources/qml/QuickSwitcher.qml
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-02-22 23:08:42 +0530
committerJedi18 <targetakhil@gmail.com>2021-02-22 23:08:42 +0530
commit3f4ad1dd8b506462cc463b67a23adf0c7fce88aa (patch)
tree47e4851857bac3707335b31b100ba80c8d2ef2aa /resources/qml/QuickSwitcher.qml
parentadd room alias delegate, fix some quickswitcher ui problems (diff)
downloadnheko-3f4ad1dd8b506462cc463b67a23adf0c7fce88aa.tar.xz
selecting room in quickswitcher now works, added completionSelected signal
Diffstat (limited to 'resources/qml/QuickSwitcher.qml')
-rw-r--r--resources/qml/QuickSwitcher.qml19
1 files changed, 19 insertions, 0 deletions
diff --git a/resources/qml/QuickSwitcher.qml b/resources/qml/QuickSwitcher.qml
index ca7a5eeb..b94fc0e2 100644
--- a/resources/qml/QuickSwitcher.qml
+++ b/resources/qml/QuickSwitcher.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.3
 import im.nheko 1.0
 
 Popup {
+    id: quickSwitcher
     x: parent.width / 2 - width / 2
     y: parent.height / 4 - height / 2
     width: parent.width / 2
@@ -20,6 +21,16 @@ Popup {
         onTextEdited: {
             completerPopup.completer.setSearchString(text)
         }
+
+        Keys.onPressed: {
+            if (event.key == Qt.Key_Up && completerPopup.opened) {
+                event.accepted = true;
+                completerPopup.up();
+            } else if (event.key == Qt.Key_Down && completerPopup.opened) {
+                event.accepted = true;
+                completerPopup.down();
+            }
+        }
     }
 
     Completer {
@@ -43,4 +54,12 @@ Popup {
     onClosed: {
         completerPopup.close()
     }
+
+    Connections {
+        onCompletionSelected: {
+            TimelineManager.setHistoryView(id)
+            quickSwitcher.close()
+        }
+        target: completerPopup
+    }
 }
\ No newline at end of file