diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2021-02-19 14:03:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 14:03:42 +0000 |
commit | 99efe2f06b310a8d5398fcb7647b99c269872e4e (patch) | |
tree | d6f5f0734a6e06a15c96ed69f6afdbd61ea24732 /resources/qml | |
parent | Merge pull request #474 from Jedi18/room_settings_qml (diff) | |
parent | check for empty alias and percent encoding for alias in url (diff) | |
download | nheko-99efe2f06b310a8d5398fcb7647b99c269872e4e.tar.xz |
Merge pull request #479 from Jedi18/add_rooms_model_completer
Add rooms completion model
Diffstat (limited to 'resources/qml')
-rw-r--r-- | resources/qml/Completer.qml | 29 | ||||
-rw-r--r-- | resources/qml/MessageInput.qml | 3 |
2 files changed, 32 insertions, 0 deletions
diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml index 27322172..f77f50e9 100644 --- a/resources/qml/Completer.qml +++ b/resources/qml/Completer.qml @@ -154,6 +154,35 @@ Popup { } + DelegateChoice { + roleValue: "room" + + RowLayout { + id: del + + anchors.centerIn: parent + + Avatar { + height: 24 + width: 24 + url: model.avatarUrl.replace("mxc://", "image://MxcImage/") + onClicked: popup.completionClicked(completer.completionAt(model.index)) + } + + Label { + text: model.roomName + color: model.index == popup.currentIndex ? colors.highlightedText : colors.text + } + + Label { + text: "(" + model.roomAlias + ")" + color: model.index == popup.currentIndex ? colors.highlightedText : colors.buttonText + } + + } + + } + } } diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index b5c96660..7ecaf81a 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -183,6 +183,9 @@ Rectangle { } else if (event.key == Qt.Key_Colon) { messageInput.openCompleter(cursorPosition, "emoji"); popup.open(); + } else if (event.key == Qt.Key_NumberSign) { + messageInput.openCompleter(cursorPosition, "room"); + popup.open(); } else if (event.key == Qt.Key_Escape && popup.opened) { completerTriggeredAt = -1; popup.completerName = ""; |