Fix the alignments for the sliders in the simulation view.

Contributes to CURA-5772.
This commit is contained in:
Diego Prado Gesto 2018-10-26 09:52:02 +02:00
parent e64698209c
commit a8531a335d
2 changed files with 21 additions and 14 deletions

View file

@ -167,7 +167,7 @@ Item
id: rangleHandleLabel id: rangleHandleLabel
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
x: parent.x - width - UM.Theme.getSize("default_margin").width x: parent.x + parent.width + UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
target: Qt.point(sliderRoot.width, y + height / 2) target: Qt.point(sliderRoot.width, y + height / 2)
visible: sliderRoot.activeHandle == parent visible: sliderRoot.activeHandle == parent
@ -275,7 +275,7 @@ Item
id: upperHandleLabel id: upperHandleLabel
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
x: parent.x - width - UM.Theme.getSize("default_margin").width x: parent.x + parent.width + UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
target: Qt.point(sliderRoot.width, y + height / 2) target: Qt.point(sliderRoot.width, y + height / 2)
visible: sliderRoot.activeHandle == parent visible: sliderRoot.activeHandle == parent
@ -385,7 +385,7 @@ Item
id: lowerHandleLabel id: lowerHandleLabel
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
x: parent.x - width - UM.Theme.getSize("default_margin").width x: parent.x + parent.width + UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
target: Qt.point(sliderRoot.width, y + height / 2) target: Qt.point(sliderRoot.width, y + height / 2)
visible: sliderRoot.activeHandle == parent visible: sliderRoot.activeHandle == parent

View file

@ -588,13 +588,14 @@ Item
id: slidersBox id: slidersBox
width: parent.width width: parent.width
height: parent.height
visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity visible: UM.SimulationView.layerActivity && CuraApplication.platformActivity
anchors anchors
{ {
top: parent.bottom top: parent.top
topMargin: UM.Theme.getSize("slider_layerview_margin").height leftMargin: UM.Theme.getSize("slider_layerview_margin").height
left: parent.left left: parent.right
} }
PathSlider PathSlider
@ -602,9 +603,13 @@ Item
id: pathSlider id: pathSlider
height: UM.Theme.getSize("slider_handle").width height: UM.Theme.getSize("slider_handle").width
anchors.left: playButton.right anchors
anchors.leftMargin: UM.Theme.getSize("default_margin").width {
anchors.right: parent.right verticalCenter: playButton.verticalCenter
left: playButton.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
}
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
// custom properties // custom properties
@ -650,10 +655,11 @@ Item
anchors anchors
{ {
top: !UM.SimulationView.compatibilityMode ? pathSlider.bottom : parent.top bottom: !UM.SimulationView.compatibilityMode ? pathSlider.top : parent.bottom
topMargin: !UM.SimulationView.compatibilityMode ? UM.Theme.getSize("default_margin").height : 0 top: parent.top
right: parent.right bottomMargin: !UM.SimulationView.compatibilityMode ? UM.Theme.getSize("default_margin").height : 0
rightMargin: UM.Theme.getSize("slider_layerview_margin").width left: parent.left
leftMargin: Math.round(UM.Theme.getSize("slider_layerview_margin").width / 2)
} }
// custom properties // custom properties
@ -704,7 +710,8 @@ Item
visible: !UM.SimulationView.compatibilityMode visible: !UM.SimulationView.compatibilityMode
anchors anchors
{ {
verticalCenter: pathSlider.verticalCenter left: parent.left
bottom: parent.bottom
} }
property var status: 0 // indicates if it's stopped (0) or playing (1) property var status: 0 // indicates if it's stopped (0) or playing (1)