Commit dedc5711 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Include a clear icon in the search field

parent db212c8e
......@@ -19,10 +19,12 @@
***************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.1 as QQC1
import QtQuick.Controls 2.1
TextField
{
id: searchField
property QtObject page
property string currentSearchText
......@@ -39,6 +41,20 @@ TextField
Component.onCompleted: forceActiveFocus()
QQC1.ToolButton {
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
margins: Kirigami.Units.smallSpacing
}
iconName: "edit-clear"
onClicked: {
searchField.text = ""
searchField.accepted()
}
}
Connections {
ignoreUnknownSignals: true
target: page
......
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