Fix HButton height for icon-only buttons

The button only considered its label previously to calculate its
implicit height.
This commit is contained in:
miruka 2020-07-11 17:55:05 -04:00
parent b8264d123c
commit 58e7321941
2 changed files with 3 additions and 2 deletions

View File

@ -8,8 +8,7 @@ Button {
id: button id: button
enabled: ! button.loading enabled: ! button.loading
spacing: theme.spacing spacing: theme.spacing
topPadding: topPadding: padded ? spacing * (circle ? 1 : 0.5) : 0
padded ? spacing * (circle ? (iconItem.small ? 1.5 : 1.8) : 0.5) : 0
bottomPadding: topPadding bottomPadding: topPadding
leftPadding: padded ? spacing : 0 leftPadding: padded ? spacing : 0
rightPadding: leftPadding rightPadding: leftPadding

View File

@ -26,6 +26,8 @@ HRowLayout {
Layout.preferredWidth: Layout.preferredWidth:
button.loading ? busyIndicatorLoader.width : icon.width button.loading ? busyIndicatorLoader.width : icon.width
Layout.preferredHeight:
button.loading ? busyIndicatorLoader.height : icon.height
Layout.fillHeight: true Layout.fillHeight: true
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter