Chat List: Let a timer do the model change

This commit is contained in:
Sebastian Wolf 2020-12-30 16:44:23 +01:00
parent e15c171640
commit 11058bc05a
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A

View file

@ -92,6 +92,11 @@ Page {
running: false running: false
repeat: false repeat: false
onTriggered: { onTriggered: {
if (chatSearchField.text === "") {
chatListView.model = chatListModel;
} else {
chatListView.model = chatListProxyModel;
}
chatListProxyModel.setFilterWildcard("*" + chatSearchField.text + "*"); chatListProxyModel.setFilterWildcard("*" + chatSearchField.text + "*");
} }
} }
@ -325,7 +330,7 @@ Page {
clip: true clip: true
opacity: overviewPage.chatListCreated ? 1 : 0 opacity: overviewPage.chatListCreated ? 1 : 0
Behavior on opacity { FadeAnimation {} } Behavior on opacity { FadeAnimation {} }
model: chatSearchField.text !== "" ? chatListProxyModel : chatListModel model: chatListModel
delegate: ChatListViewItem { delegate: ChatListViewItem {
ownUserId: overviewPage.ownUserId ownUserId: overviewPage.ownUserId
isVerified: is_verified isVerified: is_verified