diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 0b0167a6ab..5850989119 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -19,6 +19,29 @@ Rectangle property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0 property int backendState: UM.Backend.state + + property bool showProgress: { + // determine if we need to show the progress bar + percentage + if(!printerConnected || !printerAcceptsCommands) + return false; + + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": // heating, etc. + case "paused": + return true; + case "wait_cleanup": + case "ready": // nut sure if this occurs, "" seems to be the ready state. + case "offline": + case "abort": // note sure if this jobState actually occurs in the wild + case "error": // after clicking abort you apparently get "error" + case "": // ready to print + default: + return false; + } + } + property variant statusColor: { if(!printerConnected || !printerAcceptsCommands) @@ -96,7 +119,7 @@ Rectangle color: base.statusColor font: UM.Theme.getFont("large") text: Math.round(progress) + "%" - visible: printerConnected + visible: showProgress } Rectangle @@ -110,6 +133,7 @@ Rectangle anchors.leftMargin: UM.Theme.getSize("default_margin").width radius: UM.Theme.getSize("progressbar_radius").width color: UM.Theme.getColor("progressbar_background") + visible: showProgress Rectangle {