From 0c91d01eb26793e745138c4598cf15d9a21c0136 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Mar 2017 12:11:49 +0100 Subject: Filtering for maillistmodel and peoplemodel Works surprisingly well and is very useful for testing. The searchbar in the maillistmodel is a temporary solution as the global searchbar has some usability issues. E.g. how do we reset the search? As an intermediate step we could just hide the searchbar and make it visible by clicking on the search button. --- components/package/contents/ui/MailListView.qml | 11 ++++++++++- components/package/contents/ui/People.qml | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'components/package/contents') diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index 35fd4ec9..97c1a0d4 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -31,6 +31,7 @@ Item { property variant currentMail: null property bool isDraft : false property int currentIndex + property string filterString: searchBar.text; onParentFolderChanged: { currentMail = null @@ -88,10 +89,17 @@ Item { } } + TextField { + id: searchBar + anchors.top: toolbar.bottom + width: parent.width + placeholderText: qsTr("Filter...") + } + ListView { id: listView - anchors.top: toolbar.bottom + anchors.top: searchBar.bottom width: parent.width height: parent.height - toolbar.height @@ -120,6 +128,7 @@ Item { model: KubeFramework.MailListModel { parentFolder: root.parentFolder + filter: root.filterString } delegate: Item { diff --git a/components/package/contents/ui/People.qml b/components/package/contents/ui/People.qml index f280e45b..de8425df 100644 --- a/components/package/contents/ui/People.qml +++ b/components/package/contents/ui/People.qml @@ -55,6 +55,7 @@ Popup { } TextField { + id: searchBar anchors.centerIn: parent placeholderText: "Search..." @@ -122,7 +123,9 @@ Popup { Repeater { - model: KubeFramework.PeopleModel{} + model: KubeFramework.PeopleModel { + filter: searchBar.text + } delegate: Rectangle { id: delegateRoot -- cgit v1.2.3