diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-04-19 16:16:11 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-20 08:50:01 +0000 |
commit | 2c16d86b4b839eb8958c3bb210f0682a27618d48 (patch) | |
tree | dbbaa7d89ad1fe0bac8dcb1b9f16a3429de32b39 /src/imports/controls/material | |
parent | a27c3913c9888b8bb0ca909573d43a015d6f0631 (diff) |
Align and cleanup implicit size bindings
Change-Id: I9f206c3c750fd648ba8761c574e0be94d32e940f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material')
20 files changed, 56 insertions, 42 deletions
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index 45191da6..44f407ea 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -45,8 +45,8 @@ T.CheckBox { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 8 padding: 8 diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index 429ce84f..2c149606 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -47,8 +47,8 @@ T.CheckDelegate { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: 8 diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 45f1a6c4..9bde3fb6 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -48,8 +48,8 @@ T.ComboBox { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index 562c648c..74d14cd7 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -44,8 +44,10 @@ T.Drawer { parent: T.Overlay.overlay - implicitWidth: Math.max(implicitBackgroundWidth, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + contentHeight + topPadding + bottomPadding) topPadding: !dim && edge === Qt.BottomEdge && Material.elevation === 0 leftPadding: !dim && edge === Qt.RightEdge && Material.elevation === 0 diff --git a/src/imports/controls/material/Frame.qml b/src/imports/controls/material/Frame.qml index f472c4c6..024997a4 100644 --- a/src/imports/controls/material/Frame.qml +++ b/src/imports/controls/material/Frame.qml @@ -42,8 +42,10 @@ import QtQuick.Controls.Material.impl 2.5 T.Frame { id: control - implicitWidth: Math.max(implicitBackgroundWidth, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + contentHeight + topPadding + bottomPadding) padding: 12 verticalPadding: Material.frameVerticalPadding diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index 78e9c29e..3af0424e 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -43,9 +43,10 @@ T.GroupBox { id: control implicitWidth: Math.max(implicitBackgroundWidth, - implicitLabelWidth + leftPadding + rightPadding, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding) + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + contentHeight + topPadding + bottomPadding) spacing: 6 padding: 12 diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml index 072aea71..c0387070 100644 --- a/src/imports/controls/material/ItemDelegate.qml +++ b/src/imports/controls/material/ItemDelegate.qml @@ -47,8 +47,8 @@ T.ItemDelegate { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: 8 diff --git a/src/imports/controls/material/MenuBarItem.qml b/src/imports/controls/material/MenuBarItem.qml index f361a9ec..008f29ce 100644 --- a/src/imports/controls/material/MenuBarItem.qml +++ b/src/imports/controls/material/MenuBarItem.qml @@ -47,7 +47,8 @@ T.MenuBarItem { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - implicitContentHeight + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: 12 diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index fb5f7055..7da34468 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -47,8 +47,8 @@ T.MenuItem { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: Material.menuItemVerticalPadding diff --git a/src/imports/controls/material/MenuSeparator.qml b/src/imports/controls/material/MenuSeparator.qml index ff535411..14629df5 100644 --- a/src/imports/controls/material/MenuSeparator.qml +++ b/src/imports/controls/material/MenuSeparator.qml @@ -41,8 +41,10 @@ import QtQuick.Controls.Material 2.5 T.MenuSeparator { id: control - implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, implicitContentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + implicitContentHeight + topPadding + bottomPadding) verticalPadding: 8 diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml index b0f702f0..1d2ac201 100644 --- a/src/imports/controls/material/Pane.qml +++ b/src/imports/controls/material/Pane.qml @@ -42,8 +42,10 @@ import QtQuick.Controls.Material.impl 2.5 T.Pane { id: control - implicitWidth: Math.max(implicitBackgroundWidth, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml index d370a8e3..23ea7157 100644 --- a/src/imports/controls/material/Popup.qml +++ b/src/imports/controls/material/Popup.qml @@ -45,9 +45,9 @@ T.Popup { Material.elevation: 24 implicitWidth: Math.max(implicitBackgroundWidth, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) + contentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index f6dc6100..d9d97d5c 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -45,8 +45,8 @@ T.RadioButton { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 8 padding: 8 diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml index cce9a519..b448d051 100644 --- a/src/imports/controls/material/RadioDelegate.qml +++ b/src/imports/controls/material/RadioDelegate.qml @@ -47,8 +47,8 @@ T.RadioDelegate { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: 8 diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index 5badf1e2..601dcef5 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -43,11 +43,11 @@ T.RangeSlider { id: control implicitWidth: Math.max(implicitBackgroundWidth, - Math.max(first.implicitHandleWidth, - second.implicitHandleWidth) + leftPadding + rightPadding) + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(first.implicitHandleHeight, - second.implicitHandleHeight) + topPadding + bottomPadding) + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index cf555caa..522315ff 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -47,8 +47,8 @@ T.SwipeDelegate { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: 8 diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index 7886442c..f5e4ffe2 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -45,8 +45,8 @@ T.Switch { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 8 spacing: 8 diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index 077901b6..1507e382 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -47,8 +47,8 @@ T.SwitchDelegate { implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight, - Math.max(implicitContentHeight, - implicitIndicatorHeight) + topPadding + bottomPadding) + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 verticalPadding: Material.switchDelegateVerticalPadding diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml index b56e4e6a..c0d71541 100644 --- a/src/imports/controls/material/ToolBar.qml +++ b/src/imports/controls/material/ToolBar.qml @@ -44,8 +44,10 @@ T.ToolBar { Material.elevation: 4 - implicitWidth: Math.max(implicitBackgroundWidth, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + contentHeight + topPadding + bottomPadding) Material.foreground: Material.toolTextColor diff --git a/src/imports/controls/material/ToolSeparator.qml b/src/imports/controls/material/ToolSeparator.qml index 4d7b0623..da0c1cfc 100644 --- a/src/imports/controls/material/ToolSeparator.qml +++ b/src/imports/controls/material/ToolSeparator.qml @@ -41,8 +41,10 @@ import QtQuick.Controls.Material 2.5 T.ToolSeparator { id: control - implicitWidth: Math.max(implicitBackgroundWidth, implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight, implicitContentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight, + implicitContentHeight + topPadding + bottomPadding) horizontalPadding: vertical ? 12 : 5 verticalPadding: vertical ? 5 : 12 |