diff options
Diffstat (limited to 'src/imports/controls/imagine/RangeSlider.qml')
-rw-r--r-- | src/imports/controls/imagine/RangeSlider.qml | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/imports/controls/imagine/RangeSlider.qml b/src/imports/controls/imagine/RangeSlider.qml index 5c7ee70e..5461cf01 100644 --- a/src/imports/controls/imagine/RangeSlider.qml +++ b/src/imports/controls/imagine/RangeSlider.qml @@ -34,26 +34,31 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - 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(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + first.handle: Image { x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) @@ -93,9 +98,6 @@ T.RangeSlider { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset scale: control.horizontal && control.mirrored ? -1 : 1 source: Imagine.url + "rangeslider-background" |