From 17183316dbaadf9dc7d432e0f6cc0e33ea94cb5f Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 5 Oct 2017 15:22:39 +0200 Subject: [PATCH] Gradual infill stepping 1 by 1 and remembering previous value - CURA-4397 --- resources/qml/SidebarSimple.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index c87bb576d0..d66a88c5e1 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -413,7 +413,7 @@ Item minimumValue: 0 maximumValue: 100 - stepSize: (parseInt(infillDensity.properties.value) % 10 == 0) ? 10 : 1 + stepSize: 1 tickmarksEnabled: true // disable slider when gradual support is enabled @@ -454,7 +454,7 @@ Item // check if a tick should be shown based on it's index and wether the infill density is a multiple of 10 (slider step size) function shouldShowTick (index) { - if ((parseInt(infillDensity.properties.value) % 10 == 0) || (index % 10 == 0)) { + if (index % 10 == 0) { return true } return false @@ -548,11 +548,17 @@ Item hoverEnabled: true enabled: true + property var previousInfillDensity: infillDensity.properties.value + onClicked: { // Restore to 90% only when enabling gradual infill if (parseInt(infillSteps.properties.value) == 0) { + previousInfillDensity = infillDensity.properties.value infillDensity.setPropertyValue("value", 90) } + else { + infillDensity.setPropertyValue("value", previousInfillDensity) + } infillSteps.setPropertyValue("value", (parseInt(infillSteps.properties.value) == 0) ? 5 : 0) } @@ -891,7 +897,6 @@ Item UM.SettingPropertyProvider { id: platformAdhesionType - containerStackId: Cura.MachineManager.activeMachineId key: "adhesion_type" watchedProperties: [ "value", "enabled" ] @@ -901,7 +906,6 @@ Item UM.SettingPropertyProvider { id: supportEnabled - containerStackId: Cura.MachineManager.activeMachineId key: "support_enable" watchedProperties: [ "value", "enabled", "description" ] @@ -911,7 +915,6 @@ Item UM.SettingPropertyProvider { id: machineExtruderCount - containerStackId: Cura.MachineManager.activeMachineId key: "machine_extruder_count" watchedProperties: [ "value" ] @@ -921,7 +924,6 @@ Item UM.SettingPropertyProvider { id: supportExtruderNr - containerStackId: Cura.MachineManager.activeMachineId key: "support_extruder_nr" watchedProperties: [ "value" ]