From ff732720ca409d1e6807066fa9421edd841b7d88 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 23 Oct 2017 12:45:07 +0200 Subject: [PATCH] Set quality slider active index to -1 for user created profile, fix for CURA-4466 --- resources/qml/SidebarSimple.qml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 23be322a70..65a3d612dc 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -98,8 +98,15 @@ Item // Set selected value if (Cura.MachineManager.activeQualityType == qualityItem.metadata.quality_type) { - qualityModel.qualitySliderActiveIndex = i - qualityModel.existingQualityProfile = 1 + + // set to -1 when switching to user created profile so all ticks are clickable + if (Cura.SimpleModeSettingsManager.isProfileUserCreated) { + qualityModel.qualitySliderActiveIndex = -1 + } else { + qualityModel.qualitySliderActiveIndex = i + } + + qualityModel.existingQualityProfile = 1 } // Set min available @@ -293,14 +300,12 @@ Item } onValueChanged: { - // Only change if an active machine is set and the slider is visible at all. - if (Cura.MachineManager.activeMachine != null && visible) - { - //Prevent updating during view initializing. Trigger only if the value changed by user - if (qualitySlider.value != qualityModel.qualitySliderActiveIndex) - { - //start updating with short delay - qualitySliderChangeTimer.start(); + // only change if an active machine is set and the slider is visible at all. + if (Cura.MachineManager.activeMachine != null && visible) { + // prevent updating during view initializing. Trigger only if the value changed by user + if (qualitySlider.value != qualityModel.qualitySliderActiveIndex) { + // start updating with short delay + qualitySliderChangeTimer.start() } } }