NIconButton: improve centering of icon in the container

This commit is contained in:
Lemmy
2025-12-29 22:20:57 -05:00
parent 50685937da
commit 92c1741292
+3 -4
View File
@@ -61,10 +61,9 @@ Rectangle {
}
applyUiScale: root.applyUiScale
color: root.enabled && root.hovering ? colorFgHover : colorFg
// Center horizontally
x: (root.width - width) / 2
// Center vertically accounting for font metrics
y: (root.height - height) / 2 + (height - contentHeight) / 2
// Pixel-perfect centering
x: Style.pixelAlignCenter(root.width, width)
y: Style.pixelAlignCenter(root.height, contentHeight)
Behavior on color {
ColorAnimation {