CuraStage.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from PyQt6.QtCore import pyqtProperty, QUrl
  4. from UM.Stage import Stage
  5. # Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
  6. # to indicate this.
  7. # * The StageMenuComponent is the horizontal area below the stage bar. This should be used to show stage specific
  8. # buttons and elements. This component will be drawn over the bar & main component.
  9. # * The MainComponent is the component that will be drawn starting from the bottom of the stageBar and fills the rest
  10. # of the screen.
  11. class CuraStage(Stage):
  12. def __init__(self, parent = None) -> None:
  13. super().__init__(parent)
  14. # True if the toolbar should be visible when this stage is active
  15. self._toolbarEnabled = False
  16. @pyqtProperty(str, constant = True)
  17. def stageId(self) -> str:
  18. return self.getPluginId()
  19. @pyqtProperty(QUrl, constant = True)
  20. def mainComponent(self) -> QUrl:
  21. return self.getDisplayComponent("main")
  22. @pyqtProperty(QUrl, constant = True)
  23. def stageMenuComponent(self) -> QUrl:
  24. return self.getDisplayComponent("menu")
  25. @pyqtProperty(bool, constant = True)
  26. def toolbarEnabled(self) -> bool:
  27. return self._toolbarEnabled
  28. __all__ = ["CuraStage"]