diff options
author | Tor Arne Vestbø <[email protected]> | 2024-12-16 11:54:40 +0100 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2024-12-18 20:37:27 +0100 |
commit | ae7a573fe9d74f8d8355ca95f66ba160fa176270 (patch) | |
tree | 8957c88a3dea4406fb1f06b74adb6c34787436ae /src/quickcontrols/material | |
parent | 7c968ac1512b8eede38f213708f314701547c784 (diff) |
Compute implicitSize based on implicitContentSize in Pane and subclasses
Now that Pane reflects its explicitly set contentWidth/Height through
implicitContentWidth/Height we can use the same expression for implicit
width/height as regular controls, which hooks us into the safe area
binding loop detection as well.
Pick-to: 6.9
Change-Id: Ie31b740a1e405341fc5f0ed9673b213292e4afd9
Reviewed-by: Oliver Eftevaag <[email protected]>
Diffstat (limited to 'src/quickcontrols/material')
-rw-r--r-- | src/quickcontrols/material/Frame.qml | 4 | ||||
-rw-r--r-- | src/quickcontrols/material/GroupBox.qml | 4 | ||||
-rw-r--r-- | src/quickcontrols/material/Page.qml | 4 | ||||
-rw-r--r-- | src/quickcontrols/material/Pane.qml | 4 | ||||
-rw-r--r-- | src/quickcontrols/material/ScrollView.qml | 4 | ||||
-rw-r--r-- | src/quickcontrols/material/ToolBar.qml | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/quickcontrols/material/Frame.qml b/src/quickcontrols/material/Frame.qml index da9cd65581..6e5016d6f4 100644 --- a/src/quickcontrols/material/Frame.qml +++ b/src/quickcontrols/material/Frame.qml @@ -10,9 +10,9 @@ T.Frame { id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) + implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding) padding: 12 verticalPadding: Material.frameVerticalPadding diff --git a/src/quickcontrols/material/GroupBox.qml b/src/quickcontrols/material/GroupBox.qml index f0cee7c854..068987f9f4 100644 --- a/src/quickcontrols/material/GroupBox.qml +++ b/src/quickcontrols/material/GroupBox.qml @@ -10,10 +10,10 @@ T.GroupBox { id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, + implicitContentWidth + leftPadding + rightPadding, implicitLabelWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding) spacing: 6 padding: 12 diff --git a/src/quickcontrols/material/Page.qml b/src/quickcontrols/material/Page.qml index f8a1804f32..e4ce362412 100644 --- a/src/quickcontrols/material/Page.qml +++ b/src/quickcontrols/material/Page.qml @@ -10,11 +10,11 @@ T.Page { id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, + implicitContentWidth + leftPadding + rightPadding, implicitHeaderWidth, implicitFooterWidth) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding + implicitContentHeight + topPadding + bottomPadding + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) diff --git a/src/quickcontrols/material/Pane.qml b/src/quickcontrols/material/Pane.qml index 80385a073f..cd7e463eae 100644 --- a/src/quickcontrols/material/Pane.qml +++ b/src/quickcontrols/material/Pane.qml @@ -10,9 +10,9 @@ T.Pane { id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) + implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding) padding: 12 Material.roundedScale: control.Material.elevation > 0 ? Material.ExtraSmallScale : Material.NotRounded diff --git a/src/quickcontrols/material/ScrollView.qml b/src/quickcontrols/material/ScrollView.qml index 60789313c9..a465f97f63 100644 --- a/src/quickcontrols/material/ScrollView.qml +++ b/src/quickcontrols/material/ScrollView.qml @@ -9,9 +9,9 @@ T.ScrollView { id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) + implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding) ScrollBar.vertical: ScrollBar { parent: control diff --git a/src/quickcontrols/material/ToolBar.qml b/src/quickcontrols/material/ToolBar.qml index 71eb56833e..9838d47c36 100644 --- a/src/quickcontrols/material/ToolBar.qml +++ b/src/quickcontrols/material/ToolBar.qml @@ -12,9 +12,9 @@ T.ToolBar { Material.elevation: 0 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) + implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding) Material.foreground: Material.toolTextColor |