mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
Merge branch 'master' into WIP_onboarding
This commit is contained in:
commit
ae9395aebb
13 changed files with 69 additions and 104 deletions
|
@ -68,6 +68,7 @@ Column
|
|||
|
||||
property var printMaterialLengths: PrintInformation.materialLengths
|
||||
property var printMaterialWeights: PrintInformation.materialWeights
|
||||
property var printMaterialCosts: PrintInformation.materialCosts
|
||||
|
||||
text:
|
||||
{
|
||||
|
@ -77,6 +78,7 @@ Column
|
|||
}
|
||||
var totalLengths = 0
|
||||
var totalWeights = 0
|
||||
var totalCosts = 0.0
|
||||
if (printMaterialLengths)
|
||||
{
|
||||
for(var index = 0; index < printMaterialLengths.length; index++)
|
||||
|
@ -85,9 +87,16 @@ Column
|
|||
{
|
||||
totalLengths += printMaterialLengths[index]
|
||||
totalWeights += Math.round(printMaterialWeights[index])
|
||||
var cost = printMaterialCosts[index] == undefined ? 0.0 : printMaterialCosts[index]
|
||||
totalCosts += cost
|
||||
}
|
||||
}
|
||||
}
|
||||
if(totalCosts > 0)
|
||||
{
|
||||
var costString = "%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(totalCosts.toFixed(2))
|
||||
return totalWeights + "g · " + totalLengths.toFixed(2) + "m · " + costString
|
||||
}
|
||||
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
|
||||
}
|
||||
source: UM.Theme.getIcon("spool")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue