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