ViewMenu.qml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (c) 2016 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 UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Menu
  8. {
  9. title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
  10. id: base
  11. enabled: !PrintInformation.preSliced
  12. property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
  13. // main views
  14. Instantiator
  15. {
  16. model: UM.ViewModel{}
  17. MenuItem
  18. {
  19. text: model.name
  20. checkable: true
  21. checked: model.active
  22. exclusiveGroup: group
  23. onTriggered: UM.Controller.setActiveView(model.id)
  24. }
  25. onObjectAdded: base.insertItem(index, object)
  26. onObjectRemoved: base.removeItem(object)
  27. }
  28. ExclusiveGroup { id: group }
  29. MenuSeparator {}
  30. Menu
  31. {
  32. title: catalog.i18nc("@action:inmenu menubar:view","&Camera position");
  33. MenuItem { action: Cura.Actions.view3DCamera; }
  34. MenuItem { action: Cura.Actions.viewFrontCamera; }
  35. MenuItem { action: Cura.Actions.viewTopCamera; }
  36. MenuItem { action: Cura.Actions.viewLeftSideCamera; }
  37. MenuItem { action: Cura.Actions.viewRightSideCamera; }
  38. }
  39. MenuSeparator {
  40. visible: UM.Preferences.getValue("cura/use_multi_build_plate")
  41. }
  42. Menu
  43. {
  44. id: buildPlateMenu;
  45. title: catalog.i18nc("@action:inmenu menubar:view","&Build plate");
  46. visible: UM.Preferences.getValue("cura/use_multi_build_plate")
  47. Instantiator
  48. {
  49. model: base.multiBuildPlateModel
  50. MenuItem {
  51. text: base.multiBuildPlateModel.getItem(index).name;
  52. onTriggered: Cura.SceneController.setActiveBuildPlate(base.multiBuildPlateModel.getItem(index).buildPlateNumber);
  53. checkable: true;
  54. checked: base.multiBuildPlateModel.getItem(index).buildPlateNumber == base.multiBuildPlateModel.activeBuildPlate;
  55. exclusiveGroup: buildPlateGroup;
  56. visible: UM.Preferences.getValue("cura/use_multi_build_plate")
  57. }
  58. onObjectAdded: buildPlateMenu.insertItem(index, object);
  59. onObjectRemoved: buildPlateMenu.removeItem(object)
  60. }
  61. ExclusiveGroup { id: buildPlateGroup; }
  62. }
  63. MenuSeparator {}
  64. MenuItem { action: Cura.Actions.expandSidebar; }
  65. }