diff options
Diffstat (limited to 'framework/qml/MailListView.qml')
-rw-r--r-- | framework/qml/MailListView.qml | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 7e6f584d..998d9729 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml | |||
@@ -31,19 +31,10 @@ FocusScope { | |||
31 | property bool isTrash : false | 31 | property bool isTrash : false |
32 | property bool isUnread : false | 32 | property bool isUnread : false |
33 | property variant currentMail: null | 33 | property variant currentMail: null |
34 | property bool showFilter: false | 34 | property alias filter: mailListModel.filter |
35 | property string filter: null | ||
36 | |||
37 | onFilterChanged: { | ||
38 | Kube.Fabric.postMessage(Kube.Messages.searchString, {"searchString": filter}) | ||
39 | } | ||
40 | 35 | ||
41 | onParentFolderChanged: { | 36 | onParentFolderChanged: { |
42 | currentMail = null | 37 | currentMail = null |
43 | filterField.clearSearch() | ||
44 | } | ||
45 | onShowFilterChanged: { | ||
46 | find.forceActiveFocus() | ||
47 | } | 38 | } |
48 | 39 | ||
49 | Kube.Listener { | 40 | Kube.Listener { |
@@ -74,45 +65,6 @@ FocusScope { | |||
74 | 65 | ||
75 | spacing: 0 | 66 | spacing: 0 |
76 | 67 | ||
77 | Rectangle { | ||
78 | id: filterField | ||
79 | Layout.fillWidth: true | ||
80 | height: Kube.Units.gridUnit * 2 | ||
81 | color: Kube.Colors.buttonColor | ||
82 | visible: root.showFilter | ||
83 | |||
84 | function clearSearch() { | ||
85 | root.showFilter = false | ||
86 | find.text = "" | ||
87 | root.filter = "" | ||
88 | } | ||
89 | |||
90 | RowLayout { | ||
91 | anchors { | ||
92 | verticalCenter: parent.verticalCenter | ||
93 | } | ||
94 | |||
95 | width: parent.width - Kube.Units.smallSpacing | ||
96 | spacing: 0 | ||
97 | |||
98 | Kube.IconButton { | ||
99 | iconName: Kube.Icons.remove | ||
100 | activeFocusOnTab: visible | ||
101 | onClicked: filterField.clearSearch() | ||
102 | } | ||
103 | |||
104 | Kube.TextField { | ||
105 | id: find | ||
106 | Layout.fillWidth: true | ||
107 | placeholderText: qsTr("Filter...") | ||
108 | onTextChanged: root.filter = text | ||
109 | activeFocusOnTab: visible | ||
110 | focus: visible | ||
111 | Keys.onEscapePressed: filterField.clearSearch() | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | |||
116 | Kube.ListView { | 68 | Kube.ListView { |
117 | id: listView | 69 | id: listView |
118 | objectName: "listView" | 70 | objectName: "listView" |
@@ -156,7 +108,6 @@ FocusScope { | |||
156 | model: Kube.MailListModel { | 108 | model: Kube.MailListModel { |
157 | id: mailListModel | 109 | id: mailListModel |
158 | parentFolder: root.parentFolder | 110 | parentFolder: root.parentFolder |
159 | filter: root.filter | ||
160 | } | 111 | } |
161 | 112 | ||
162 | delegate: Kube.ListDelegate { | 113 | delegate: Kube.ListDelegate { |