mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Show weights as well as lengths
CURA-1038
This commit is contained in:
parent
1f53ce0d4d
commit
9171908c8b
1 changed files with 11 additions and 5 deletions
|
@ -195,15 +195,21 @@ Rectangle {
|
|||
color: UM.Theme.getColor("text_subtext")
|
||||
text:
|
||||
{
|
||||
var amounts = [];
|
||||
var lengths = [];
|
||||
var weights = [];
|
||||
if(base.printMaterialLengths) {
|
||||
for(var index = 0; index < base.printMaterialLengths.length; index++) {
|
||||
amounts.push(base.printMaterialLengths[index].toFixed(2));
|
||||
if(base.printMaterialLengths[index] > 0) {
|
||||
lengths.push(base.printMaterialLengths[index].toFixed(2));
|
||||
weights.push(String(Math.floor(base.printMaterialWeights[index])));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
amounts = ["0.00"];
|
||||
}
|
||||
return catalog.i18nc("@label", "%1 m").arg(amounts.join(" + "));
|
||||
if(lengths.length == 0) {
|
||||
lengths = ["0.00"];
|
||||
weights = ["0"];
|
||||
}
|
||||
return catalog.i18nc("@label", "%1 m / %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue