From aaab6339129e1f49182684a265b35671e698ad3e Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 8 Dec 2022 13:18:29 +0100 Subject: [PATCH] Move labels into `Slider` component CURA-9793 --- resources/qml/Widgets/SingleSettingSlider.qml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/qml/Widgets/SingleSettingSlider.qml b/resources/qml/Widgets/SingleSettingSlider.qml index a941a348b8..1277e2ccda 100644 --- a/resources/qml/Widgets/SingleSettingSlider.qml +++ b/resources/qml/Widgets/SingleSettingSlider.qml @@ -6,16 +6,14 @@ import QtQuick.Controls 2.15 import UM 1.7 as UM import Cura 1.7 as Cura -import QtQuick.Layouts 1.3 // This silder allows changing of a single setting. Only the setting name has to be passed in to "settingName". // All of the setting updating logic is handled by this component. // This component allows you to choose values between minValue -> maxValue and rounds them to the nearest 10. // If the setting is limited to a single extruder or is settable with different values per extruder use "updateAllExtruders: true" -RowLayout +Item { height: childrenRect.height - spacing: UM.Theme.getSize("default_margin").width property alias settingName: propertyProvider.key property alias enabled: settingSlider.enabled @@ -39,12 +37,9 @@ RowLayout storeIndex: 0 } - UM.Label { Layout.fillWidth: false; text: minValue } - UM.Slider { id: settingSlider - Layout.fillWidth: true width: parent.width @@ -54,11 +49,15 @@ RowLayout value: parseInt(propertyProvider.properties.value) // When the slider is released trigger an update immediately. This forces the slider to snap to the rounded value. - onPressedChanged: if(!pressed) { roundSliderValueUpdateSetting() } + onPressedChanged: function(pressed) + { + if(!pressed) + { + roundSliderValueUpdateSetting(); + } + } } - UM.Label { Layout.fillWidth: false; text: maxValue } - Connections { target: propertyProvider