mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Add printer type selector if connected to cluster
If there are 2 or more printer types in your connected cluster, you can switch the printer type here. Contributes to issue CURA-5876.
This commit is contained in:
parent
78df27369f
commit
ffcac04f9e
1 changed files with 48 additions and 1 deletions
|
@ -36,10 +36,57 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
//Printer type selector.
|
||||
Item
|
||||
{
|
||||
id: printerTypeSelectorRow
|
||||
visible:
|
||||
{
|
||||
return Cura.MachineManager.printerOutputDevices.length >= 1 //If connected...
|
||||
&& Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount != null //...and we have configuration information...
|
||||
&& Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1; //...and there is more than one type of printer in the configuration list.
|
||||
}
|
||||
height: visible ? childrenRect.height : 0
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
top: header.bottom
|
||||
topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Printer")
|
||||
width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width
|
||||
height: contentHeight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.verticalCenter: printerTypeSelector.verticalCenter
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
OldControls.ToolButton
|
||||
{
|
||||
id: printerTypeSelector
|
||||
text: Cura.MachineManager.activeMachineDefinitionName
|
||||
tooltip: Cura.MachineManager.activeMachineDefinitionName
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
|
||||
menu: Cura.PrinterTypeMenu { }
|
||||
}
|
||||
}
|
||||
|
||||
UM.TabRow
|
||||
{
|
||||
id: tabBar
|
||||
anchors.top: header.bottom
|
||||
anchors.top: printerTypeSelectorRow.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
visible: extrudersModel.count > 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue