Commit 0378e5a0 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Close plasmoid using escape

parent 74dbb98d
...@@ -32,6 +32,7 @@ import "globals.js" as Globals ...@@ -32,6 +32,7 @@ import "globals.js" as Globals
*/ */
Item { Item {
signal searchTextChanged() signal searchTextChanged()
signal close()
property alias text: textField.text property alias text: textField.text
height: childrenRect.height height: childrenRect.height
...@@ -70,6 +71,10 @@ Item { ...@@ -70,6 +71,10 @@ Item {
} }
Keys.onEscapePressed: { Keys.onEscapePressed: {
textField.text = "" if (textField.text) {
textField.text = ""
} else {
close()
}
} }
} }
...@@ -63,6 +63,7 @@ Item { ...@@ -63,6 +63,7 @@ Item {
onSearchTextChanged: { onSearchTextChanged: {
listView.setQueryString(text) listView.setQueryString(text)
} }
onClose: plasmoid.expanded = false
} }
Milou.ResultsView { Milou.ResultsView {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment