mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Make the height of the layer slider dynamic
Prevents the action panel from overlapping the layer slider CURA-6853
This commit is contained in:
parent
b78f34db12
commit
5bb23e4c6f
4 changed files with 16 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue