mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
NIconButton: improve centering of icon in the container
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user