Fix front view button rotation, cleanup view buttons onClicked

This commit is contained in:
ChrisTerBeke 2018-01-03 16:18:31 +01:00
parent 392be23281
commit 5a9e3a8efd

View file

@ -115,10 +115,8 @@ Rectangle
iconSource: UM.Theme.getIcon("view_3d")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:{
UM.Controller.rotateView("3d", 0);
}
visible: base.width - allItemsWidth - 4 * this.width > 0;
onClicked:UM.Controller.rotateView("3d", 0)
visible: base.width - allItemsWidth - 4 * this.width > 0
}
// #2 Front view
@ -127,10 +125,11 @@ Rectangle
iconSource: UM.Theme.getIcon("view_front")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:{
UM.Controller.rotateView("home", 0);
onClicked: {
UM.Controller.rotateView("x", 0)
UM.Controller.rotateView("y", 0)
}
visible: base.width - allItemsWidth - 3 * this.width > 0;
visible: base.width - allItemsWidth - 3 * this.width > 0
}
// #3 Top view
@ -139,10 +138,8 @@ Rectangle
iconSource: UM.Theme.getIcon("view_top")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:{
UM.Controller.rotateView("y", 90);
}
visible: base.width - allItemsWidth - 2 * this.width > 0;
onClicked: UM.Controller.rotateView("y", 90)
visible: base.width - allItemsWidth - 2 * this.width > 0
}
// #4 Left view
@ -151,10 +148,8 @@ Rectangle
iconSource: UM.Theme.getIcon("view_left")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:{
UM.Controller.rotateView("x", 90);
}
visible: base.width - allItemsWidth - 1 * this.width > 0;
onClicked: UM.Controller.rotateView("x", 90)
visible: base.width - allItemsWidth - 1 * this.width > 0
}
// #5 Left view
@ -163,10 +158,8 @@ Rectangle
iconSource: UM.Theme.getIcon("view_right")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:{
UM.Controller.rotateView("x", -90);
}
visible: base.width - allItemsWidth > 0;
onClicked: UM.Controller.rotateView("x", -90)
visible: base.width - allItemsWidth > 0
}
}