diff options
Diffstat (limited to 'plugins/SimulationView/SimulationViewMainComponent.qml')
-rw-r--r-- | plugins/SimulationView/SimulationViewMainComponent.qml | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml index 8d32e50654..bfd8799673 100644 --- a/plugins/SimulationView/SimulationViewMainComponent.qml +++ b/plugins/SimulationView/SimulationViewMainComponent.qml @@ -18,7 +18,10 @@ Item property bool isSimulationPlaying: false - readonly property var layerSliderSafeYMax: safeArea.y + safeArea.height + readonly property real layerSliderSafeYMin: safeArea.y + readonly property real layerSliderSafeYMax: safeArea.y + safeArea.height + readonly property real pathSliderSafeXMin: safeArea.x + playButton.width + readonly property real pathSliderSafeXMax: safeArea.x + safeArea.width visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity @@ -26,13 +29,21 @@ Item PathSlider { id: pathSlider + + readonly property real preferredWidth: UM.Theme.getSize("slider_layerview_size").height // not a typo, should be as long as layerview slider + readonly property real margin: UM.Theme.getSize("default_margin").width + readonly property real pathSliderSafeWidth: pathSliderSafeXMax - pathSliderSafeXMin + height: UM.Theme.getSize("slider_handle").width - width: UM.Theme.getSize("slider_layerview_size").height + width: preferredWidth + margin * 2 < pathSliderSafeWidth ? preferredWidth : pathSliderSafeWidth - margin * 2 + anchors.bottom: parent.bottom - anchors.bottomMargin: UM.Theme.getSize("default_margin").height + anchors.bottomMargin: margin anchors.horizontalCenter: parent.horizontalCenter + anchors.horizontalCenterOffset: -(parent.width - pathSliderSafeXMax - pathSliderSafeXMin) / 2 // center between parent top and layerSliderSafeYMax + visible: !UM.SimulationView.compatibilityMode @@ -184,16 +195,18 @@ Item { property var preferredHeight: UM.Theme.getSize("slider_layerview_size").height property double heightMargin: UM.Theme.getSize("default_margin").height * 3 // extra margin to accomodate layer number tooltips + property double layerSliderSafeHeight: layerSliderSafeYMax - layerSliderSafeYMin + id: layerSlider width: UM.Theme.getSize("slider_handle").width - height: preferredHeight + heightMargin * 2 < layerSliderSafeYMax ? preferredHeight : layerSliderSafeYMax - heightMargin * 2 + height: preferredHeight + heightMargin * 2 < layerSliderSafeHeight ? preferredHeight : layerSliderSafeHeight - heightMargin * 2 anchors { right: parent.right verticalCenter: parent.verticalCenter - verticalCenterOffset: -(parent.height - layerSliderSafeYMax) / 2 // center between parent top and layerSliderSafeYMax + verticalCenterOffset: -(parent.height - layerSliderSafeYMax - layerSliderSafeYMin) / 2 // center between parent top and layerSliderSafeYMax rightMargin: UM.Theme.getSize("default_margin").width bottomMargin: heightMargin topMargin: heightMargin |