Change PC3 Button and ToolButton implicitWidth and implicitHeight to account for inset values

This commit is contained in:
Noah Davis 2020-08-30 02:06:06 -04:00
parent 73865f7171
commit 9e9136bddd
2 changed files with 10 additions and 14 deletions

View File

@ -14,10 +14,10 @@ import "private" as Private
T.Button { T.Button {
id: control id: control
implicitWidth: Math.max(units.gridUnit, contentItem.implicitWidth) implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ leftPadding + rightPadding implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(units.gridUnit, contentItem.implicitHeight) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ topPadding + bottomPadding implicitContentHeight + topPadding + bottomPadding)
Layout.minimumWidth: contentItem.implicitWidth + leftPadding + rightPadding Layout.minimumWidth: contentItem.implicitWidth + leftPadding + rightPadding
@ -86,7 +86,5 @@ T.Button {
} }
} }
background: Private.ButtonBackground { background: Private.ButtonBackground {}
parentControl: control
}
} }

View File

@ -14,10 +14,10 @@ import "private" as Private
T.ToolButton { T.ToolButton {
id: control id: control
implicitWidth: Math.max(units.gridUnit, contentItem.implicitWidth) implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ leftPadding + rightPadding implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(units.gridUnit, contentItem.implicitHeight) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ topPadding + bottomPadding implicitContentHeight + topPadding + bottomPadding)
Layout.minimumWidth: contentItem.implicitWidth + leftPadding + rightPadding Layout.minimumWidth: contentItem.implicitWidth + leftPadding + rightPadding
@ -96,7 +96,5 @@ T.ToolButton {
} }
} }
background: Private.ButtonBackground { background: Private.ButtonBackground {}
parentControl: control
}
} }