diff --git a/plugins/PreviewStage/PreviewMain.qml b/plugins/PreviewStage/PreviewMain.qml index a065a751ac..1b8387644d 100644 --- a/plugins/PreviewStage/PreviewMain.qml +++ b/plugins/PreviewStage/PreviewMain.qml @@ -11,6 +11,17 @@ import Cura 1.0 as Cura Item { + + // Subtract the actionPanel from the safe area. This way the view won't draw interface elements under/over it + Item { + id: safeArea + visible: false + anchors.left: parent.left + anchors.right: actionPanelWidget.left + anchors.top: parent.top + anchors.bottom: actionPanelWidget.top + } + Loader { id: previewMain @@ -18,12 +29,11 @@ Item source: UM.Controller.activeView != null && UM.Controller.activeView.mainComponent != null ? UM.Controller.activeView.mainComponent : "" - // Indicate that the layer slider should stay above the action panel Binding { target: previewMain.item - property: "layerSliderSafeYMax" - value: actionPanelWidget.y + property: "safeArea" + value:safeArea } } diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index ddbb5b6224..65621605df 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -11,11 +11,14 @@ import Cura 1.0 as Cura Item { + // An Item whose bounds are guaranteed to be safe for overlays to be placed. + // Defaults to parent, ie. the entire available area + // eg. the layer slider will not be placed in this area. + property var safeArea: parent + + property bool isSimulationPlaying: 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 + readonly property var layerSliderSafeYMax: safeArea.y + safeArea.height visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity @@ -221,6 +224,7 @@ Item // Make sure the slider handlers show the correct value after switching views Component.onCompleted: { + print("safeArea: " + safeArea, "layerSliderSafeYMax", layerSliderSafeYMax) layerSlider.setLowerValue(UM.SimulationView.minimumLayer) layerSlider.setUpperValue(UM.SimulationView.currentLayer) }