NIconButton: animation on color (bg+fg)

This commit is contained in:
LemmyCook 2025-09-09 08:56:30 -04:00
parent f6b3f6d2ec
commit d76d1c628a

View file

@ -38,6 +38,13 @@ Rectangle {
border.color: root.enabled && root.hovering ? colorBorderHover : colorBorder
border.width: Math.max(1, Style.borderS * scaling)
Behavior on color {
ColorAnimation {
duration: Style.animationNormal
easing.type: Easing.InOutQuad
}
}
NIcon {
icon: root.icon
font.pointSize: Math.max(1, root.width * 0.4)
@ -46,6 +53,13 @@ Rectangle {
x: (root.width - width) / 2
// Center vertically accounting for font metrics
y: (root.height - height) / 2 + (height - contentHeight) / 2
Behavior on color {
ColorAnimation {
duration: Style.animationFast
easing.type: Easing.InOutQuad
}
}
}
NTooltip {