From 058e3946dfbef24309515d27c985048866b69fc9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 12 Jun 2016 22:36:41 +0200 Subject: 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 --- src/imports/controls/universal/RangeSlider.qml | 10 ++++------ src/imports/controls/universal/Slider.qml | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/imports/controls/universal') 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 -- cgit v1.2.3