Merge pull request #6 from ChungZH/main

feat: Add clear action
This commit is contained in:
Reion Wong 2021-07-13 10:53:14 +08:00 committed by GitHub
commit 6b9d6639d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ Window {
anchors.margins: FishUI.Units.largeSpacing anchors.margins: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing
TextField { FishUI.ActionTextField {
id: _textField id: _textField
Layout.fillWidth: true Layout.fillWidth: true
Keys.onEscapePressed: control.close() Keys.onEscapePressed: control.close()
@ -63,6 +63,15 @@ Window {
Component.onCompleted: { Component.onCompleted: {
_textField.selectAll() _textField.selectAll()
} }
rightActions: [
Action {
icon.source: "image://icontheme/edit-clear"
onTriggered: {
_textField.text = ""
}
}
]
} }
RowLayout { RowLayout {