Browse Source

CL-470 Add icons to the printer state box on the monitor tab.

Subtask of CL-457 Cura plugin: primary visual improvements
Simon Edwards 7 years ago
parent
commit
3abf25937b

+ 37 - 1
plugins/UM3NetworkPrinting/PrinterInfoBlock.qml

@@ -223,6 +223,9 @@ Rectangle
                     //border.color: lineColor
                     height: 40 * screenScaleFactor
                     anchors.left: parent.left
+                    property var showPercent: {
+                        return printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.status) !== -1);
+                    }
 
                     Label
                     {
@@ -283,6 +286,7 @@ Rectangle
 
                         font: UM.Theme.getFont("small")
                     }
+
                     Label
                     {
                         id: progressText
@@ -292,10 +296,42 @@ Rectangle
                         anchors.top: statusText.top
 
                         text: formatPrintJobPercent(printJob)
-                        visible: printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.status) !== -1)
+                        visible: printProgressTitleBar.showPercent
                         opacity: 0.65
                         font: UM.Theme.getFont("very_small")
                     }
+
+                    Image 
+                    {
+                        width: 16 * screenScaleFactor
+                        height: width
+                        anchors.right: parent.right
+                        anchors.rightMargin: UM.Theme.getSize("default_margin").width
+                        anchors.top: statusText.top
+
+                        visible: ! printProgressTitleBar.showPercent
+                        
+                        source: {
+                            if ( ! printer.enabled)
+                            {
+                                return "blocked-icon.svg";
+                            }
+                            if (printJob != null)
+                            {
+                                if(printJob.status === "queued")
+                                {
+                                    if (printJob.configuration_changes_required != null && printJob.configuration_changes_required.length !== 0)
+                                    {
+                                        return "action-required-icon.svg";
+                                    }
+                                } else if (printJob.status === "wait_cleanup")
+                                {
+                                    return "checkmark-icon.svg";
+                                }
+                            }
+                        }
+                    }
+
                     Rectangle
                     {
                         //TODO: This will become a progress bar in the future

+ 8 - 0
plugins/UM3NetworkPrinting/action-required-icon.svg

@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28">
+    <g fill="none" fill-rule="evenodd" opacity=".601">
+        <path stroke="#000" stroke-width="2.5" d="M14.865 2.491l11.264 19.421a1 1 0 0 1-.865 1.502H2.736a1 1 0 0 1-.865-1.502l11.264-19.42a1 1 0 0 1 1.73 0z"/>
+        <text fill="#000" font-family="sans-serif" font-size="15" font-weight="600" letter-spacing=".3" transform="translate(1 1)">
+            <tspan x="11" y="19">!</tspan>
+        </text>
+    </g>
+</svg>

+ 6 - 0
plugins/UM3NetworkPrinting/blocked-icon.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
+    <g fill="none" fill-rule="evenodd">
+        <circle cx="12" cy="12" r="12" fill="#494949"/>
+        <path fill="#FFF" d="M6 10h12v4H6z"/>
+    </g>
+</svg>

+ 3 - 0
plugins/UM3NetworkPrinting/checkmark-icon.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+    <path fill="none" fill-rule="evenodd" stroke="#000" stroke-width="2.5" d="M1 6.71L8.068 13 19 1"/>
+</svg>