diff --git a/resources/qml/ActionPanelWidget.qml b/resources/qml/ActionPanel/ActionPanelWidget.qml similarity index 100% rename from resources/qml/ActionPanelWidget.qml rename to resources/qml/ActionPanel/ActionPanelWidget.qml diff --git a/resources/qml/OutputDevicesActionButton.qml b/resources/qml/ActionPanel/OutputDevicesActionButton.qml similarity index 100% rename from resources/qml/OutputDevicesActionButton.qml rename to resources/qml/ActionPanel/OutputDevicesActionButton.qml diff --git a/resources/qml/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml similarity index 84% rename from resources/qml/OutputProcessWidget.qml rename to resources/qml/ActionPanel/OutputProcessWidget.qml index 435cc6da79..bef40fdfca 100644 --- a/resources/qml/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -61,25 +61,20 @@ Column function getText() { - var lengths = [] - var weights = [] - if(printMaterialLengths) + var totalLengths = 0 + var totalWeights = 0 + if (printMaterialLengths) { for(var index = 0; index < printMaterialLengths.length; index++) { if(printMaterialLengths[index] > 0) { - lengths.push(printMaterialLengths[index].toFixed(2)) - weights.push(String(Math.round(printMaterialWeights[index]))) + totalLengths += printMaterialLengths[index] + totalWeights += Math.round(printMaterialWeights[index]) } } } - if(lengths.length == 0) - { - lengths = ["0.00"] - weights = ["0"] - } - return weights.join(" + ") + "g · " + lengths.join(" + ") + "m" + return totalWeights + "g · " + totalLengths.toFixed(2) + "m" } text: getText() @@ -116,13 +111,15 @@ Column Cura.ActionButton { + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("action_panel_button").height text: catalog.i18nc("@button", "Preview") color: UM.Theme.getColor("secondary") hoverColor: UM.Theme.getColor("secondary") textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") - onClicked: console.log("Clicking preview") + onClicked: UM.Controller.setActiveStage("MonitorStage") } Cura.OutputDevicesActionButton diff --git a/resources/qml/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml similarity index 100% rename from resources/qml/SliceProcessWidget.qml rename to resources/qml/ActionPanel/SliceProcessWidget.qml