feat: Add clear action
This commit is contained in:
parent
8acf67fcf7
commit
7f86732e82
2 changed files with 19 additions and 2 deletions
|
@ -48,7 +48,7 @@ Window {
|
|||
anchors.margins: FishUI.Units.largeSpacing
|
||||
spacing: FishUI.Units.largeSpacing
|
||||
|
||||
TextField {
|
||||
FishUI.ActionTextField {
|
||||
id: _textField
|
||||
Layout.fillWidth: true
|
||||
Keys.onEscapePressed: control.close()
|
||||
|
@ -63,6 +63,15 @@ Window {
|
|||
Component.onCompleted: {
|
||||
_textField.selectAll()
|
||||
}
|
||||
|
||||
rightActions: [
|
||||
Action {
|
||||
icon.source: "image://icontheme/edit-clear"
|
||||
onTriggered: {
|
||||
_textField.text = ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
@ -80,13 +80,21 @@ Window {
|
|||
source: "image://icontheme/" + main.iconName
|
||||
}
|
||||
|
||||
TextField {
|
||||
FishUI.ActionTextField {
|
||||
id: _textField
|
||||
text: main.fileName
|
||||
focus: true
|
||||
Layout.fillWidth: true
|
||||
Keys.onEscapePressed: control.close()
|
||||
enabled: !main.multiple && main.isWritable
|
||||
rightActions: [
|
||||
Action {
|
||||
icon.source: "image://icontheme/edit-clear"
|
||||
onTriggered: {
|
||||
_textField.text = ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue