summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-02-23 00:18:31 +0530
committerJedi18 <targetakhil@gmail.com>2021-02-23 00:18:31 +0530
commitb1dec6f6acec929495f66ef7d0fcb3cac9ee25e3 (patch)
tree835ae4d880c4eda53fe1d6f26b25c11f51ec72c7 /resources/qml
parentselecting room in quickswitcher now works, added completionSelected signal (diff)
downloadnheko-b1dec6f6acec929495f66ef7d0fcb3cac9ee25e3.tar.xz
enter key now works, fix room highlighting and add overlay
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/Completer.qml7
-rw-r--r--resources/qml/QuickSwitcher.qml9
-rw-r--r--resources/qml/TimelineView.qml1
3 files changed, 16 insertions, 1 deletions
diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml
index a4f81e6e..cef19fbf 100644
--- a/resources/qml/Completer.qml
+++ b/resources/qml/Completer.qml
@@ -52,6 +52,12 @@ Popup {
             return null;
     }
 
+    function finishCompletion() {
+        if(popup.completerName == "room") {
+            popup.completionSelected(listView.itemAtIndex(currentIndex).modelData.roomid)
+        }
+    }
+
     onCompleterNameChanged: {
         if (completerName) {
             if (completerName == "user") {
@@ -85,6 +91,7 @@ Popup {
             color: model.index == popup.currentIndex ? colors.highlight : colors.base
             height: chooser.childrenRect.height + 4
             implicitWidth: fullWidth ? popup.width : chooser.childrenRect.width + 4
+            property variant modelData: model
 
             MouseArea {
                 id: mouseArea
diff --git a/resources/qml/QuickSwitcher.qml b/resources/qml/QuickSwitcher.qml
index b94fc0e2..609c443f 100644
--- a/resources/qml/QuickSwitcher.qml
+++ b/resources/qml/QuickSwitcher.qml
@@ -11,6 +11,10 @@ Popup {
     closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
     parent: Overlay.overlay
 
+    Overlay.modal: Rectangle {
+        color: "#aa1E1E1E"
+    }
+
     TextInput {
         id: roomTextInput
 
@@ -29,6 +33,9 @@ Popup {
             } else if (event.key == Qt.Key_Down && completerPopup.opened) {
                 event.accepted = true;
                 completerPopup.down();
+            } else if (event.matches(StandardKey.InsertParagraphSeparator)) {
+                completerPopup.finishCompletion()
+                event.accepted = true;
             }
         }
     }
@@ -57,7 +64,9 @@ Popup {
 
     Connections {
         onCompletionSelected: {
+            console.log(id)
             TimelineManager.setHistoryView(id)
+            TimelineManager.highlightRoom(id)
             quickSwitcher.close()
         }
         target: completerPopup
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index f575e133..8c84c145 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -72,7 +72,6 @@ Page {
         id: quickSwitcherComponent
 
         QuickSwitcher {
-            id: quickSwitcher
         }
     }