ViewOrientationControls.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // A row of buttons that control the view direction
  8. Row
  9. {
  10. id: viewOrientationControl
  11. spacing: UM.Theme.getSize("narrow_margin").width
  12. height: childrenRect.height
  13. width: childrenRect.width
  14. ViewOrientationButton
  15. {
  16. iconSource: UM.Theme.getIcon("view_3d")
  17. onClicked: UM.Controller.rotateView("3d", 0)
  18. }
  19. ViewOrientationButton
  20. {
  21. iconSource: UM.Theme.getIcon("view_front")
  22. onClicked: UM.Controller.rotateView("home", 0)
  23. }
  24. ViewOrientationButton
  25. {
  26. iconSource: UM.Theme.getIcon("view_top")
  27. onClicked: UM.Controller.rotateView("y", 90)
  28. }
  29. ViewOrientationButton
  30. {
  31. iconSource: UM.Theme.getIcon("view_left")
  32. onClicked: UM.Controller.rotateView("x", 90)
  33. }
  34. ViewOrientationButton
  35. {
  36. iconSource: UM.Theme.getIcon("view_right")
  37. onClicked: UM.Controller.rotateView("x", -90)
  38. }
  39. }