From b1dec6f6acec929495f66ef7d0fcb3cac9ee25e3 Mon Sep 17 00:00:00 2001 From: Jedi18 Date: Tue, 23 Feb 2021 00:18:31 +0530 Subject: enter key now works, fix room highlighting and add overlay --- resources/qml/Completer.qml | 7 +++++++ resources/qml/QuickSwitcher.qml | 9 +++++++++ resources/qml/TimelineView.qml | 1 - 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'resources/qml') 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 } } -- cgit 1.5.1