diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 12:11:49 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 12:11:49 +0100 |
commit | 0c91d01eb26793e745138c4598cf15d9a21c0136 (patch) | |
tree | 53ffeb02eaf1625598e937444430e4040e17b0a4 /components | |
parent | ed09c7689f7435761611cbfd3cda98bbd79c3a5e (diff) | |
download | kube-0c91d01eb26793e745138c4598cf15d9a21c0136.tar.gz kube-0c91d01eb26793e745138c4598cf15d9a21c0136.zip |
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.
Diffstat (limited to 'components')
-rw-r--r-- | components/mail/contents/ui/Mail.qml | 1 | ||||
-rw-r--r-- | components/package/contents/ui/MailListView.qml | 11 | ||||
-rw-r--r-- | components/package/contents/ui/People.qml | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml index 1ae4062d..c5078877 100644 --- a/components/mail/contents/ui/Mail.qml +++ b/components/mail/contents/ui/Mail.qml | |||
@@ -395,6 +395,7 @@ Controls2.ApplicationWindow { | |||
395 | anchors.fill: parent | 395 | anchors.fill: parent |
396 | 396 | ||
397 | Controls2.TextField { | 397 | Controls2.TextField { |
398 | id: searchField | ||
398 | Layout.fillWidth: true | 399 | Layout.fillWidth: true |
399 | placeholderText: "Search... is not available in this beta" | 400 | placeholderText: "Search... is not available in this beta" |
400 | } | 401 | } |
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 { | |||
31 | property variant currentMail: null | 31 | property variant currentMail: null |
32 | property bool isDraft : false | 32 | property bool isDraft : false |
33 | property int currentIndex | 33 | property int currentIndex |
34 | property string filterString: searchBar.text; | ||
34 | 35 | ||
35 | onParentFolderChanged: { | 36 | onParentFolderChanged: { |
36 | currentMail = null | 37 | currentMail = null |
@@ -88,10 +89,17 @@ Item { | |||
88 | } | 89 | } |
89 | } | 90 | } |
90 | 91 | ||
92 | TextField { | ||
93 | id: searchBar | ||
94 | anchors.top: toolbar.bottom | ||
95 | width: parent.width | ||
96 | placeholderText: qsTr("Filter...") | ||
97 | } | ||
98 | |||
91 | ListView { | 99 | ListView { |
92 | id: listView | 100 | id: listView |
93 | 101 | ||
94 | anchors.top: toolbar.bottom | 102 | anchors.top: searchBar.bottom |
95 | 103 | ||
96 | width: parent.width | 104 | width: parent.width |
97 | height: parent.height - toolbar.height | 105 | height: parent.height - toolbar.height |
@@ -120,6 +128,7 @@ Item { | |||
120 | 128 | ||
121 | model: KubeFramework.MailListModel { | 129 | model: KubeFramework.MailListModel { |
122 | parentFolder: root.parentFolder | 130 | parentFolder: root.parentFolder |
131 | filter: root.filterString | ||
123 | } | 132 | } |
124 | 133 | ||
125 | delegate: Item { | 134 | 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 { | |||
55 | } | 55 | } |
56 | 56 | ||
57 | TextField { | 57 | TextField { |
58 | id: searchBar | ||
58 | anchors.centerIn: parent | 59 | anchors.centerIn: parent |
59 | 60 | ||
60 | placeholderText: "Search..." | 61 | placeholderText: "Search..." |
@@ -122,7 +123,9 @@ Popup { | |||
122 | 123 | ||
123 | Repeater { | 124 | Repeater { |
124 | 125 | ||
125 | model: KubeFramework.PeopleModel{} | 126 | model: KubeFramework.PeopleModel { |
127 | filter: searchBar.text | ||
128 | } | ||
126 | 129 | ||
127 | delegate: Rectangle { | 130 | delegate: Rectangle { |
128 | id: delegateRoot | 131 | id: delegateRoot |