PreviewMenu.qml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 2.3
  5. import UM 1.3 as UM
  6. import Cura 1.1 as Cura
  7. Item
  8. {
  9. id: previewMenu
  10. property real itemHeight: height - 2 * UM.Theme.getSize("default_lining").width
  11. UM.I18nCatalog
  12. {
  13. id: catalog
  14. name: "cura"
  15. }
  16. Row
  17. {
  18. id: stageMenuRow
  19. anchors.centerIn: parent
  20. height: parent.height
  21. Cura.ViewsSelector
  22. {
  23. id: viewsSelector
  24. height: parent.height
  25. width: UM.Theme.getSize("views_selector").width
  26. headerCornerSide: Cura.RoundedRectangle.Direction.Left
  27. }
  28. // Separator line
  29. Rectangle
  30. {
  31. height: parent.height
  32. // If there is no viewPanel, we only need a single spacer, so hide this one.
  33. visible: viewPanel.source != ""
  34. width: visible ? UM.Theme.getSize("default_lining").width : 0
  35. color: UM.Theme.getColor("lining")
  36. }
  37. Loader
  38. {
  39. id: viewPanel
  40. height: parent.height
  41. width: childrenRect.width
  42. source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : ""
  43. }
  44. // Separator line
  45. Rectangle
  46. {
  47. height: parent.height
  48. width: UM.Theme.getSize("default_lining").width
  49. color: UM.Theme.getColor("lining")
  50. }
  51. Item
  52. {
  53. id: printSetupSelectorItem
  54. // This is a work around to prevent the printSetupSelector from having to be re-loaded every time
  55. // a stage switch is done.
  56. children: [printSetupSelector]
  57. height: childrenRect.height
  58. width: childrenRect.width
  59. }
  60. }
  61. }