diff --git a/plugins/PreviewStage/PreviewMain.qml b/plugins/PreviewStage/PreviewMain.qml index 6b5ce2436b..cd448dc0b6 100644 --- a/plugins/PreviewStage/PreviewMain.qml +++ b/plugins/PreviewStage/PreviewMain.qml @@ -13,6 +13,7 @@ Item { Loader { + property var panelTop: actionPanelWidget.y id: previewMain anchors.fill: parent diff --git a/plugins/SimulationView/LayerSlider.qml b/plugins/SimulationView/LayerSlider.qml index 88f298d1f5..d2af1e223b 100644 --- a/plugins/SimulationView/LayerSlider.qml +++ b/plugins/SimulationView/LayerSlider.qml @@ -176,6 +176,11 @@ Item } } + onHeightChanged : { + print("new height:" + height) + //rangeHandle.onHandleDragged() + } + // Upper handle Rectangle { diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index 28d5a74523..3a7cb0d2fe 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -48,7 +48,7 @@ if TYPE_CHECKING: catalog = i18nCatalog("cura") -## View used to display g-code paths. +## The preview layer view. It is used to display g-code paths. class SimulationView(CuraView): # Must match SimulationViewMenuComponent.qml LAYER_VIEW_TYPE_MATERIAL_TYPE = 0 diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index 58901652d3..51fc70ade8 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -14,6 +14,7 @@ Item property bool is_simulation_playing: false visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity + // A slider which lets users trace a single layer (XY movements) PathSlider { id: pathSlider @@ -170,18 +171,24 @@ Item } } + // Scrolls trough Z layers LayerSlider { + property var preferredHeight: UM.Theme.getSize("slider_layerview_size").height + property double heightMargin: UM.Theme.getSize("default_margin").height id: layerSlider width: UM.Theme.getSize("slider_handle").width - height: UM.Theme.getSize("slider_layerview_size").height + height: preferredHeight + heightMargin * 2 < panelTop ? preferredHeight : panelTop - heightMargin * 2 anchors { right: parent.right verticalCenter: parent.verticalCenter + verticalCenterOffset: -(parent.height - panelTop) / 2 // center between parent top and panelTop rightMargin: UM.Theme.getSize("default_margin").width + bottomMargin: heightMargin + topMargin: heightMargin } // Custom properties @@ -209,6 +216,7 @@ 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) }