ViewOrientationControls.qml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. import Cura 1.1 as Cura
  8. // A row of buttons that control the view direction
  9. Row
  10. {
  11. id: viewOrientationControl
  12. spacing: UM.Theme.getSize("narrow_margin").width
  13. height: childrenRect.height
  14. width: childrenRect.width
  15. ViewOrientationButton
  16. {
  17. iconSource: UM.Theme.getIcon("view_3d")
  18. onClicked: Cura.Actions.view3DCamera.trigger()
  19. UM.TooltipArea
  20. {
  21. anchors.fill: parent
  22. text: catalog.i18nc("@info:tooltip", "3D View")
  23. }
  24. }
  25. ViewOrientationButton
  26. {
  27. iconSource: UM.Theme.getIcon("view_front")
  28. onClicked: Cura.Actions.viewFrontCamera.trigger()
  29. UM.TooltipArea
  30. {
  31. anchors.fill: parent
  32. text: catalog.i18nc("@info:tooltip", "Front View")
  33. }
  34. }
  35. ViewOrientationButton
  36. {
  37. iconSource: UM.Theme.getIcon("view_top")
  38. onClicked: Cura.Actions.viewTopCamera.trigger()
  39. UM.TooltipArea
  40. {
  41. anchors.fill: parent
  42. text: catalog.i18nc("@info:tooltip", "Top View")
  43. }
  44. }
  45. ViewOrientationButton
  46. {
  47. iconSource: UM.Theme.getIcon("view_left")
  48. onClicked: Cura.Actions.viewLeftSideCamera.trigger()
  49. UM.TooltipArea
  50. {
  51. anchors.fill: parent
  52. text: catalog.i18nc("@info:tooltip", "Left View")
  53. }
  54. }
  55. ViewOrientationButton
  56. {
  57. iconSource: UM.Theme.getIcon("view_right")
  58. onClicked: Cura.Actions.viewRightSideCamera.trigger()
  59. UM.TooltipArea
  60. {
  61. anchors.fill: parent
  62. text: catalog.i18nc("@info:tooltip", "Right View")
  63. }
  64. }
  65. }