Skip to content

ButtonContent: Center the GridLayout itself

Kai Uwe Broulik requested to merge work/kbroulik/centered-button-content into master

When setting an icon width/height, a maximum size is set on the relevant icon so it will never be resized larger, despite the outer Grid being fillWidth/fillHeight, and therefore placed in the default left alignment.


6.3?

Before:

leftaligned

After:

Screenshot_20250117_172512

PC3.ToolButton {
    Layout.minimumWidth: 100
    display: PC3.AbstractButton.IconOnly
    icon.width: Kirigami.Units.iconSizes.small
    icon.height: Kirigami.Units.iconSizes.small
    icon.name: "speedometer"
    font: Kirigami.Theme.smallFont
    text: "100%"
    checkable: true
}
Edited by Kai Uwe Broulik

Merge request reports

Loading