mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Show each material length individually
CURA-1687
This commit is contained in:
parent
c36af13daf
commit
9c492342cb
1 changed files with 15 additions and 2 deletions
|
@ -24,7 +24,7 @@ Rectangle {
|
|||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
||||
property variant printDuration: PrintInformation.currentPrintTime
|
||||
property real printMaterialAmount: PrintInformation.materialAmounts[0]
|
||||
property variant printMaterialAmounts: PrintInformation.materialAmounts
|
||||
|
||||
height: childrenRect.height
|
||||
color: "transparent"
|
||||
|
@ -192,7 +192,20 @@ Rectangle {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
text: catalog.i18nc("@label", "%1 m").arg(base.printMaterialAmount > 0 ? base.printMaterialAmount : 0)
|
||||
text:
|
||||
{
|
||||
var material_lengths;
|
||||
if(base.printMaterialAmounts) {
|
||||
material_lengths = ""
|
||||
for(var index = 0; index < base.printMaterialAmounts.length; index++) {
|
||||
material_lengths += base.printMaterialAmounts[index].toFixed(2).toString() + " + "
|
||||
}
|
||||
material_lengths = material_lengths.substr(0, material_lengths.length - 3)
|
||||
} else {
|
||||
material_lengths = "0.00"
|
||||
}
|
||||
return catalog.i18nc("@label", "%1 m").arg(material_lengths)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue