mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 07:35:59 +08:00
Show weights as well as lengths
CURA-1038
This commit is contained in:
parent
1f53ce0d4d
commit
9171908c8b
@ -195,15 +195,21 @@ Rectangle {
|
|||||||
color: UM.Theme.getColor("text_subtext")
|
color: UM.Theme.getColor("text_subtext")
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
var amounts = [];
|
var lengths = [];
|
||||||
|
var weights = [];
|
||||||
if(base.printMaterialLengths) {
|
if(base.printMaterialLengths) {
|
||||||
for(var index = 0; index < base.printMaterialLengths.length; index++) {
|
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…
x
Reference in New Issue
Block a user