From 6d828b2ba8ad4b0586853cbdf4f1b32b8a2bf753 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 22 Aug 2021 11:54:26 +0000 Subject: Add chatlist search --- qml/ChatlistPage.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'qml') diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index 7a9877b..17b0dc3 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -36,6 +36,12 @@ Kirigami.ScrollablePage { updateChatlist() } + header: Kirigami.SearchField { + id: searchField + + onTextChanged: chatlistPage.updateChatlist() + } + mainAction: Kirigami.Action { text: "New chat" iconName: "list-add" @@ -91,7 +97,8 @@ Kirigami.ScrollablePage { } function updateChatlist() { - let chatlist = chatlistPage.context.getChatlist(chatlistPage.archivedOnly ? 1 : 0) + let chatlist = chatlistPage.context.getChatlist(chatlistPage.archivedOnly ? 1 : 0, + searchField.text) // Merge new chatlist with existing one. // To preserve selected item, we do not simply clear and fill -- cgit v1.2.3-70-g09d2