ViewOrientationControls.qml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Controls.Styles 1.1
  6. import UM 1.4 as UM
  7. // View orientation Item
  8. Row
  9. {
  10. id: viewOrientationControl
  11. spacing: UM.Theme.getSize("narrow_margin").width
  12. height: childrenRect.height
  13. width: childrenRect.width
  14. // #1 3d view
  15. Button
  16. {
  17. iconSource: UM.Theme.getIcon("view_3d")
  18. style: UM.Theme.styles.small_tool_button
  19. onClicked:UM.Controller.rotateView("3d", 0)
  20. }
  21. // #2 Front view
  22. Button
  23. {
  24. iconSource: UM.Theme.getIcon("view_front")
  25. style: UM.Theme.styles.small_tool_button
  26. onClicked: UM.Controller.rotateView("home", 0)
  27. }
  28. // #3 Top view
  29. Button
  30. {
  31. iconSource: UM.Theme.getIcon("view_top")
  32. style: UM.Theme.styles.small_tool_button
  33. onClicked: UM.Controller.rotateView("y", 90)
  34. }
  35. // #4 Left view
  36. Button
  37. {
  38. iconSource: UM.Theme.getIcon("view_left")
  39. style: UM.Theme.styles.small_tool_button
  40. onClicked: UM.Controller.rotateView("x", 90)
  41. }
  42. // #5 Right view
  43. Button
  44. {
  45. iconSource: UM.Theme.getIcon("view_right")
  46. style: UM.Theme.styles.small_tool_button
  47. onClicked: UM.Controller.rotateView("x", -90)
  48. }
  49. }