diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-06-12 22:36:41 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-06-13 11:00:44 +0000 |
commit | 058e3946dfbef24309515d27c985048866b69fc9 (patch) | |
tree | 02cb6becf74dbcb562a94fe22ed768e6c80fda17 /src/imports | |
parent | b17cf27b1afd5045aa6bce923f9eebc439d4fc39 (diff) |
Sliders: fix implicit size calculations
Background size was in the bindings twice: once without and once with
paddings.
Change-Id: I863d1fe29f1d79017bad410b31f961e4d1238e3b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/controls/RangeSlider.qml | 10 | ||||
-rw-r--r-- | src/imports/controls/Slider.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/material/RangeSlider.qml | 10 | ||||
-rw-r--r-- | src/imports/controls/material/Slider.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/universal/RangeSlider.qml | 10 | ||||
-rw-r--r-- | src/imports/controls/universal/Slider.qml | 6 |
6 files changed, 18 insertions, 30 deletions
diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml index 8d285298..7353e2b5 100644 --- a/src/imports/controls/RangeSlider.qml +++ b/src/imports/controls/RangeSlider.qml @@ -41,13 +41,11 @@ T.RangeSlider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) + Math.max(first.handle ? first.handle.implicitWidth : 0, + second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + Math.max(first.handle ? first.handle.implicitHeight : 0, + second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/Slider.qml b/src/imports/controls/Slider.qml index a44a6c80..896dbca0 100644 --- a/src/imports/controls/Slider.qml +++ b/src/imports/controls/Slider.qml @@ -41,11 +41,9 @@ T.Slider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) + (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index f103fb27..acad1f6d 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -43,13 +43,11 @@ T.RangeSlider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) + Math.max(first.handle ? first.handle.implicitWidth : 0, + second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + Math.max(first.handle ? first.handle.implicitHeight : 0, + second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml index a473db37..aa85f229 100644 --- a/src/imports/controls/material/Slider.qml +++ b/src/imports/controls/material/Slider.qml @@ -43,11 +43,9 @@ T.Slider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) + (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/universal/RangeSlider.qml b/src/imports/controls/universal/RangeSlider.qml index fd220521..ec2ff7c8 100644 --- a/src/imports/controls/universal/RangeSlider.qml +++ b/src/imports/controls/universal/RangeSlider.qml @@ -42,13 +42,11 @@ T.RangeSlider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) + Math.max(first.handle ? first.handle.implicitWidth : 0, + second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + Math.max(first.handle ? first.handle.implicitHeight : 0, + second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/universal/Slider.qml b/src/imports/controls/universal/Slider.qml index 5aa336ee..baf91211 100644 --- a/src/imports/controls/universal/Slider.qml +++ b/src/imports/controls/universal/Slider.qml @@ -42,11 +42,9 @@ T.Slider { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(background ? background.implicitWidth : 0, - handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) + (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(background ? background.implicitHeight : 0, - handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) padding: 6 |