mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 09:28:58 +08:00
Update documentation & typing
CURA-5772
This commit is contained in:
parent
4743bd8bd5
commit
cc6d5617ee
@ -5,19 +5,28 @@ from PyQt5.QtCore import pyqtProperty, QUrl
|
|||||||
from UM.Stage import Stage
|
from UM.Stage import Stage
|
||||||
|
|
||||||
|
|
||||||
|
# Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
|
||||||
|
# to indicate this.
|
||||||
|
# * The StageMenuComponent is the horizontal area below the stage bar. This should be used to show stage specific
|
||||||
|
# buttons and elements. This component will be drawn over the bar & main component.
|
||||||
|
# * The MainComponent is the component that will be drawn starting from the bottom of the stageBar and fills the rest
|
||||||
|
# of the screen.
|
||||||
class CuraStage(Stage):
|
class CuraStage(Stage):
|
||||||
|
def __init__(self, parent = None) -> None:
|
||||||
def __init__(self, parent = None):
|
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def stageId(self):
|
def stageId(self) -> str:
|
||||||
return self.getPluginId()
|
return self.getPluginId()
|
||||||
|
|
||||||
@pyqtProperty(QUrl, constant = True)
|
@pyqtProperty(QUrl, constant = True)
|
||||||
def mainComponent(self):
|
def mainComponent(self) -> QUrl:
|
||||||
return self.getDisplayComponent("main")
|
return self.getDisplayComponent("main")
|
||||||
|
|
||||||
@pyqtProperty(QUrl, constant = True)
|
@pyqtProperty(QUrl, constant = True)
|
||||||
def sidebarComponent(self):
|
def sidebarComponent(self) -> QUrl:
|
||||||
return self.getDisplayComponent("sidebar")
|
return self.getDisplayComponent("sidebar")
|
||||||
|
|
||||||
|
@pyqtProperty(QUrl, constant=True)
|
||||||
|
def stageMenuComponent(self) -> QUrl:
|
||||||
|
return self.getDisplayComponent("menu")
|
@ -86,7 +86,8 @@ Rectangle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SidebarHeader {
|
SidebarHeader
|
||||||
|
{
|
||||||
id: header
|
id: header
|
||||||
width: parent.width
|
width: parent.width
|
||||||
visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants)
|
visible: !hideSettings && (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants)
|
||||||
@ -96,7 +97,8 @@ Rectangle
|
|||||||
onHideTooltip: base.hideTooltip()
|
onHideTooltip: base.hideTooltip()
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle
|
||||||
|
{
|
||||||
id: headerSeparator
|
id: headerSeparator
|
||||||
width: parent.width
|
width: parent.width
|
||||||
visible: settingsModeSelection.visible && header.visible
|
visible: settingsModeSelection.visible && header.visible
|
||||||
|
Loading…
x
Reference in New Issue
Block a user