ViewOrientationControls.qml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. acceptedButtons: Qt.NoButton
  24. }
  25. }
  26. ViewOrientationButton
  27. {
  28. iconSource: UM.Theme.getIcon("view_front")
  29. onClicked: Cura.Actions.viewFrontCamera.trigger()
  30. UM.TooltipArea
  31. {
  32. anchors.fill: parent
  33. text: catalog.i18nc("@info:tooltip", "Front View")
  34. acceptedButtons: Qt.NoButton
  35. }
  36. }
  37. ViewOrientationButton
  38. {
  39. iconSource: UM.Theme.getIcon("view_top")
  40. onClicked: Cura.Actions.viewTopCamera.trigger()
  41. UM.TooltipArea
  42. {
  43. anchors.fill: parent
  44. text: catalog.i18nc("@info:tooltip", "Top View")
  45. acceptedButtons: Qt.NoButton
  46. }
  47. }
  48. ViewOrientationButton
  49. {
  50. iconSource: UM.Theme.getIcon("view_left")
  51. onClicked: Cura.Actions.viewLeftSideCamera.trigger()
  52. UM.TooltipArea
  53. {
  54. anchors.fill: parent
  55. text: catalog.i18nc("@info:tooltip", "Left View")
  56. acceptedButtons: Qt.NoButton
  57. }
  58. }
  59. ViewOrientationButton
  60. {
  61. iconSource: UM.Theme.getIcon("view_right")
  62. onClicked: Cura.Actions.viewRightSideCamera.trigger()
  63. UM.TooltipArea
  64. {
  65. anchors.fill: parent
  66. text: catalog.i18nc("@info:tooltip", "Right View")
  67. acceptedButtons: Qt.NoButton
  68. }
  69. }
  70. }