Add a property that indicates when the layer slider or the path slider

has changed manually.

With this we can differentiate when the layer changed automatically
(during simulation) or manually (by user interaction). In case it was
changed manually, the simulation will stop.

Contributes to CURA-5725.
This commit is contained in:
Diego Prado Gesto 2018-09-17 14:02:04 +02:00
parent 2bf617b53a
commit dfae4a9a86
3 changed files with 55 additions and 16 deletions

View file

@ -34,6 +34,7 @@ Item {
property real handleValue: maximumValue
property bool pathsVisible: true
property bool manuallyChanged: true // Indicates whether the value was changed manually or during simulation
function getHandleValueFromSliderHandle () {
return handle.getValue()
@ -97,6 +98,7 @@ Item {
visible: sliderRoot.pathsVisible
function onHandleDragged () {
sliderRoot.manuallyChanged = true
// update the range handle
sliderRoot.updateRangeHandle()
@ -128,8 +130,16 @@ Item {
sliderRoot.updateRangeHandle()
}
Keys.onRightPressed: handleLabel.setValue(handleLabel.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
Keys.onLeftPressed: handleLabel.setValue(handleLabel.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
Keys.onRightPressed:
{
sliderRoot.manuallyChanged = true
handleLabel.setValue(handleLabel.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
}
Keys.onLeftPressed:
{
sliderRoot.manuallyChanged = true
handleLabel.setValue(handleLabel.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
}
// dragging
MouseArea {