aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Kozlov <AnKozlov@luxoft.com>2018-03-29 15:00:00 +0200
committerLukáš Tinkl <ltinkl@luxoft.com>2018-03-30 08:30:21 +0000
commit4570c511247f4b65ba86a150b01d7bb3049ccbe8 (patch)
tree7290cea35f63f4f418eae02c3eb2d438c374137c
parenta91393ce147017c586a761a464d94a3f58b1582a (diff)
[sysui] Fix QML warnings in the slider style
- Fix a QML warning of using the image of the handle when it's not loaded Change-Id: I3bdbd8eb0d95fd9bc300bf4f1208c7433ee461de Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> Reviewed-by: Lukáš Tinkl <ltinkl@luxoft.com>
-rw-r--r--styles/neptune/Slider.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/styles/neptune/Slider.qml b/styles/neptune/Slider.qml
index aaddeb25..b680bf1b 100644
--- a/styles/neptune/Slider.qml
+++ b/styles/neptune/Slider.qml
@@ -60,8 +60,10 @@ T.Slider {
(control.to - control.from) / control.stepSize : 0
readonly property int railSize: numberSteps > 0 ?
30 * NeptuneStyle.scale : 10 * NeptuneStyle.scale
- readonly property real railLength: control.horizontal ?
- control.availableWidth - handle.width : control.availableHeight - handle.height
+ readonly property real railLength: handle ? (control.horizontal ?
+ control.availableWidth - handle.width :
+ control.availableHeight - handle.height) :
+ (control.horizontal ? control.implicitWidth : control.implicitHeight)
readonly property real stepLength: numberSteps ?
(railLength - gap * (numberSteps - 1)) / numberSteps : 0.0
readonly property int gap: 3 * NeptuneStyle.scale