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
3755e1fdd6
commit
e966641ed1
|
@ -19,6 +19,11 @@ Column {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusBaseInput {
|
||||||
|
placeholderText: "Clearable"
|
||||||
|
clearable: true
|
||||||
|
}
|
||||||
|
|
||||||
StatusBaseInput {
|
StatusBaseInput {
|
||||||
multiline: true
|
multiline: true
|
||||||
placeholderText: "Multiline"
|
placeholderText: "Multiline"
|
||||||
|
|
|
@ -147,7 +147,10 @@ Item {
|
||||||
|
|
||||||
StatusFlatRoundButton {
|
StatusFlatRoundButton {
|
||||||
id: clearButtton
|
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.right: parent.right
|
||||||
anchors.rightMargin: 11
|
anchors.rightMargin: 11
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -157,6 +160,7 @@ Item {
|
||||||
icon.name: "clear"
|
icon.name: "clear"
|
||||||
icon.width: 14
|
icon.width: 14
|
||||||
icon.height: 14
|
icon.height: 14
|
||||||
|
icon.color: Theme.palette.baseColor1
|
||||||
onClicked: {
|
onClicked: {
|
||||||
edit.clear()
|
edit.clear()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue