diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2019-10-09 17:51:28 +0300 |
---|---|---|
committer | Nino van Hooff <ninovanhooff@gmail.com> | 2019-10-09 17:51:28 +0300 |
commit | 4148f56d2b58465055914910f08e1a92fe657586 (patch) | |
tree | c465ad7a1a026186ebf3a3b9865781231375fac6 /plugins/SimulationView | |
parent | f090450bba2349bb3b81a713f5d617d7f7316ee6 (diff) |
Remove external dependency from SimulationViewMainComponent
Previously, panelTop had to be defined externally whenever
SimulationViewMainComponent was used. I renamed it and set a default
so the binding by a parent is optional.
CURA-6853
Diffstat (limited to 'plugins/SimulationView')
-rw-r--r-- | plugins/SimulationView/LayerSlider.qml | 1 | ||||
-rw-r--r-- | plugins/SimulationView/SimulationViewMainComponent.qml | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/SimulationView/LayerSlider.qml b/plugins/SimulationView/LayerSlider.qml index 9706b04e03..15b0fdbe12 100644 --- a/plugins/SimulationView/LayerSlider.qml +++ b/plugins/SimulationView/LayerSlider.qml @@ -338,7 +338,6 @@ Item // set the slider position based on the lower value function setValue(value) { - print("lower handle set value: " + value) // Normalize values between range, since using arrow keys will create out-of-the-range values value = sliderRoot.normalizeValue(value) diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index 51fc70ade8..c115dafe26 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -12,6 +12,11 @@ import Cura 1.0 as Cura Item { property bool is_simulation_playing: false + // By default, the layer slider can extend to the entire height of the parent + // A parent may bind this property to indicate the bottom of a safe area + // for the Layer slider + property var layerSliderSafeYMax: parent.height + visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity // A slider which lets users trace a single layer (XY movements) @@ -179,13 +184,13 @@ Item id: layerSlider width: UM.Theme.getSize("slider_handle").width - height: preferredHeight + heightMargin * 2 < panelTop ? preferredHeight : panelTop - heightMargin * 2 + height: preferredHeight + heightMargin * 2 < layerSliderSafeYMax ? preferredHeight : layerSliderSafeYMax - heightMargin * 2 anchors { right: parent.right verticalCenter: parent.verticalCenter - verticalCenterOffset: -(parent.height - panelTop) / 2 // center between parent top and panelTop + verticalCenterOffset: -(parent.height - layerSliderSafeYMax) / 2 // center between parent top and layerSliderSafeYMax rightMargin: UM.Theme.getSize("default_margin").width bottomMargin: heightMargin topMargin: heightMargin @@ -216,7 +221,6 @@ Item // Make sure the slider handlers show the correct value after switching views Component.onCompleted: { - print("paneltop", panelTop, "screenscaleFactor") layerSlider.setLowerValue(UM.SimulationView.minimumLayer) layerSlider.setUpperValue(UM.SimulationView.currentLayer) } |