summaryrefslogtreecommitdiffstats
path: root/framework/qml/MailListView.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-11 23:20:29 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-09-11 23:20:29 +0200
commit77b36f40931bbfde44e67946003b3939a4f6b27a (patch)
treeb5a017d984867a8cbc367fc2d018f74bc9905e45 /framework/qml/MailListView.qml
parenta56696cdcb518d26184aee59ef72542aada6b66d (diff)
downloadkube-77b36f40931bbfde44e67946003b3939a4f6b27a.tar.gz
kube-77b36f40931bbfde44e67946003b3939a4f6b27a.zip
Clear search on esc
Diffstat (limited to 'framework/qml/MailListView.qml')
-rw-r--r--framework/qml/MailListView.qml11
1 files changed, 7 insertions, 4 deletions
diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml
index ffdacdbe..e918cebf 100644
--- a/framework/qml/MailListView.qml
+++ b/framework/qml/MailListView.qml
@@ -76,6 +76,11 @@ FocusScope {
76 color: Kube.Colors.buttonColor 76 color: Kube.Colors.buttonColor
77 visible: false 77 visible: false
78 78
79 function clearSearch() {
80 filterField.visible = false
81 mailListModel.filter = ""
82 }
83
79 RowLayout { 84 RowLayout {
80 anchors { 85 anchors {
81 verticalCenter: parent.verticalCenter 86 verticalCenter: parent.verticalCenter
@@ -87,10 +92,7 @@ FocusScope {
87 Kube.IconButton { 92 Kube.IconButton {
88 iconName: Kube.Icons.remove 93 iconName: Kube.Icons.remove
89 activeFocusOnTab: visible 94 activeFocusOnTab: visible
90 onClicked: { 95 onClicked: filterField.clearSearch()
91 filterField.visible = false
92 mailListModel.filter = ""
93 }
94 } 96 }
95 97
96 Kube.TextField { 98 Kube.TextField {
@@ -100,6 +102,7 @@ FocusScope {
100 onTextChanged: mailListModel.filter = text 102 onTextChanged: mailListModel.filter = text
101 activeFocusOnTab: visible 103 activeFocusOnTab: visible
102 focus: visible 104 focus: visible
105 Keys.onEscapePressed: filterField.clearSearch()
103 } 106 }
104 } 107 }
105 } 108 }