mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 06:05:58 +08:00
Hide extruder information when hotend/material is not provided
This happens when there is no extruder in the machine or the machine simply doesn't provide enough information. Contributes to issue CURA-3161.
This commit is contained in:
parent
f6fe4f9fd3
commit
be5b656ef7
@ -96,7 +96,7 @@ Column
|
|||||||
}
|
}
|
||||||
Label //Temperature indication.
|
Label //Temperature indication.
|
||||||
{
|
{
|
||||||
text: connectedPrinter != null ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
text: (connectedPrinter != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||||
font: UM.Theme.getFont("large")
|
font: UM.Theme.getFont("large")
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@ -107,10 +107,10 @@ Column
|
|||||||
id: materialColor
|
id: materialColor
|
||||||
width: materialName.height * 0.75
|
width: materialName.height * 0.75
|
||||||
height: materialName.height * 0.75
|
height: materialName.height * 0.75
|
||||||
color: connectedPrinter != null ? connectedPrinter.materialColors[index] : "#00000000"
|
color: (connectedPrinter != null && connectedPrinter.materialColors[index] != null) ? connectedPrinter.materialColors[index] : "#00000000"
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
visible: connectedPrinter != null
|
visible: (connectedPrinter != null && connectedPrinter.materialColors[index] != null)
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: materialName.verticalCenter
|
anchors.verticalCenter: materialName.verticalCenter
|
||||||
@ -118,7 +118,7 @@ Column
|
|||||||
Label //Material name.
|
Label //Material name.
|
||||||
{
|
{
|
||||||
id: materialName
|
id: materialName
|
||||||
text: connectedPrinter != null ? connectedPrinter.materialNames[index] : ""
|
text: (connectedPrinter != null && connectedPrinter.materialNames[index] != null) ? connectedPrinter.materialNames[index] : ""
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
anchors.left: materialColor.right
|
anchors.left: materialColor.right
|
||||||
@ -127,7 +127,7 @@ Column
|
|||||||
}
|
}
|
||||||
Label //Variant name.
|
Label //Variant name.
|
||||||
{
|
{
|
||||||
text: connectedPrinter != null ? connectedPrinter.hotendIds[index] : ""
|
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
Loading…
x
Reference in New Issue
Block a user