NIconButton + NPill: improved vertical centering

This commit is contained in:
LemmyCook 2025-08-26 14:25:36 -04:00
parent fabdf67da7
commit 2f49643e51
2 changed files with 8 additions and 7 deletions

View file

@ -103,7 +103,10 @@ Item {
font.pointSize: Style.fontSizeM * scaling
// When forced shown, use pill text color; otherwise accent color when hovered
color: forceOpen ? textColor : (showPill ? iconTextColor : Color.mOnSurface)
anchors.centerIn: parent
// Center horizontally
x: (iconCircle.width - width) / 2
// Center vertically accounting for font metrics
y: (iconCircle.height - height) / 2 + (height - contentHeight) / 2
}
}