fix(StatusBaseInput): ensure clear button has the correct color
Also only render clear button when input has active focus. Closes #286
This commit is contained in:
parent
e1ebdaae2c
commit
de1cec7e51
|
@ -19,6 +19,11 @@ Column {
|
|||
enabled: false
|
||||
}
|
||||
|
||||
StatusBaseInput {
|
||||
placeholderText: "Clearable"
|
||||
clearable: true
|
||||
}
|
||||
|
||||
StatusBaseInput {
|
||||
multiline: true
|
||||
placeholderText: "Multiline"
|
||||
|
|
|
@ -147,7 +147,10 @@ Item {
|
|||
|
||||
StatusFlatRoundButton {
|
||||
id: clearButtton
|
||||
visible: edit.text.length != 0 && statusBaseInput.clearable && !statusBaseInput.multiline
|
||||
visible: edit.text.length != 0 &&
|
||||
statusBaseInput.clearable &&
|
||||
!statusBaseInput.multiline &&
|
||||
edit.activeFocus
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 11
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
@ -157,6 +160,7 @@ Item {
|
|||
icon.name: "clear"
|
||||
icon.width: 14
|
||||
icon.height: 14
|
||||
icon.color: Theme.palette.baseColor1
|
||||
onClicked: {
|
||||
edit.clear()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue