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 {
id: control
implicitWidth: Math.max(units.gridUnit, contentItem.implicitWidth)
+ leftPadding + rightPadding
implicitHeight: Math.max(units.gridUnit, contentItem.implicitHeight)
+ topPadding + bottomPadding
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
Layout.minimumWidth: contentItem.implicitWidth + leftPadding + rightPadding
@ -86,7 +86,5 @@ T.Button {
}
}
background: Private.ButtonBackground {
parentControl: control
}
background: Private.ButtonBackground {}
}

View File

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