Fix clear button styling

This commit is contained in:
Nicolas Werner 2023-01-07 03:43:32 +01:00
parent ab580c0702
commit 55159d2469
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -131,37 +131,24 @@ ColumnLayout {
color: labelC.text ? "transparent" : backgroundColor
}
ToolButton {
ImageButton {
id: clearText
Layout.fillWidth: true
visible: c.hasClear && searchField.text !== ''
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearText.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)
image: ":/icons/icons/ui/round-remove-button.svg"
focusPolicy: Qt.NoFocus
onClicked: {
searchField.clear()
topBar.searchString = "";
}
hoverEnabled: true
background: null
anchors {
verticalCenter: parent.verticalCenter
top: parent.top
bottom: parent.bottom
right: parent.right
rightMargin: Nheko.paddingSmall
}
// clear the default hover effects.
Image {
height: parent.height - 2 * Nheko.paddingSmall
width: height
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearText.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
margins: Nheko.paddingSmall
}
}
}
}