mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 11:05:57 +08:00
In the main action panel, only show the total amount of material weight
and length (addition of all extruders). The information panel will show each cost separately. Contributes to CURA-5786.
This commit is contained in:
parent
b03695dec6
commit
310539cb6d
@ -61,25 +61,20 @@ Column
|
|||||||
|
|
||||||
function getText()
|
function getText()
|
||||||
{
|
{
|
||||||
var lengths = []
|
var totalLengths = 0
|
||||||
var weights = []
|
var totalWeights = 0
|
||||||
if(printMaterialLengths)
|
if (printMaterialLengths)
|
||||||
{
|
{
|
||||||
for(var index = 0; index < printMaterialLengths.length; index++)
|
for(var index = 0; index < printMaterialLengths.length; index++)
|
||||||
{
|
{
|
||||||
if(printMaterialLengths[index] > 0)
|
if(printMaterialLengths[index] > 0)
|
||||||
{
|
{
|
||||||
lengths.push(printMaterialLengths[index].toFixed(2))
|
totalLengths += printMaterialLengths[index]
|
||||||
weights.push(String(Math.round(printMaterialWeights[index])))
|
totalWeights += Math.round(printMaterialWeights[index])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(lengths.length == 0)
|
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
|
||||||
{
|
|
||||||
lengths = ["0.00"]
|
|
||||||
weights = ["0"]
|
|
||||||
}
|
|
||||||
return weights.join(" + ") + "g · " + lengths.join(" + ") + "m"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
text: getText()
|
text: getText()
|
||||||
@ -116,13 +111,15 @@ Column
|
|||||||
|
|
||||||
Cura.ActionButton
|
Cura.ActionButton
|
||||||
{
|
{
|
||||||
|
leftPadding: UM.Theme.getSize("default_margin").width
|
||||||
|
rightPadding: UM.Theme.getSize("default_margin").width
|
||||||
height: UM.Theme.getSize("action_panel_button").height
|
height: UM.Theme.getSize("action_panel_button").height
|
||||||
text: catalog.i18nc("@button", "Preview")
|
text: catalog.i18nc("@button", "Preview")
|
||||||
color: UM.Theme.getColor("secondary")
|
color: UM.Theme.getColor("secondary")
|
||||||
hoverColor: UM.Theme.getColor("secondary")
|
hoverColor: UM.Theme.getColor("secondary")
|
||||||
textColor: UM.Theme.getColor("primary")
|
textColor: UM.Theme.getColor("primary")
|
||||||
textHoverColor: UM.Theme.getColor("text")
|
textHoverColor: UM.Theme.getColor("text")
|
||||||
onClicked: console.log("Clicking preview")
|
onClicked: UM.Controller.setActiveStage("MonitorStage")
|
||||||
}
|
}
|
||||||
|
|
||||||
Cura.OutputDevicesActionButton
|
Cura.OutputDevicesActionButton
|
Loading…
x
Reference in New Issue
Block a user