Browse Source

Improve the machine selector header to show an icon in case it is a
network printer.

Contributes to CURA-5942.

Diego Prado Gesto 6 years ago
parent
commit
1d84bd7356

+ 2 - 0
resources/qml/ActionPanel/OutputProcessWidget.qml

@@ -47,6 +47,7 @@ Column
             {
                 id: estimatedTime
                 width: parent.width
+                height: childrenRect.height
 
                 text: PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long)
                 source: UM.Theme.getIcon("clock")
@@ -57,6 +58,7 @@ Column
             {
                 id: estimatedCosts
                 width: parent.width
+                height: childrenRect.height
 
                 property var printMaterialLengths: PrintInformation.materialLengths
                 property var printMaterialWeights: PrintInformation.materialWeights

+ 1 - 0
resources/qml/ActionPanel/SliceProcessWidget.qml

@@ -44,6 +44,7 @@ Column
     {
         id: message
         width: parent.width
+        height: childrenRect.height
         visible: widget.backendState == UM.Backend.Error
 
         text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")

+ 8 - 5
resources/qml/IconLabel.qml

@@ -16,32 +16,35 @@ Item
     property alias source: icon.source
     property alias color: label.color
     property alias font: label.font
-
-    height: childrenRect.height
+    property alias iconSize: icon.width
 
     UM.RecolorImage
     {
         id: icon
 
         anchors.left: parent.left
+        anchors.verticalCenter: parent.verticalCenter
 
-        source: UM.Theme.getIcon("dot")
+        source: ""
         width: UM.Theme.getSize("section_icon").width
-        height: UM.Theme.getSize("section_icon").height
+        height: width
 
         sourceSize.width: width
         sourceSize.height: height
 
         color: label.color
+        visible: source != ""
     }
 
     Label
     {
         id: label
-        anchors.left: icon.right
+        anchors.left: icon.visible ? icon.right : parent.left
+        anchors.right: parent.right
         anchors.leftMargin: UM.Theme.getSize("thin_margin").width
         anchors.verticalCenter: icon.verticalCenter
         text: "Empty label"
+        elide: Text.ElideRight
         color: UM.Theme.getColor("text")
         font: UM.Theme.getFont("very_small")
         renderType: Text.NativeRendering

+ 16 - 6
resources/qml/PrinterSelector/MachineSelector.qml

@@ -14,6 +14,7 @@ Cura.ExpandableComponent
     id: machineSelector
 
     property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != ""
+    property var outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
 
     popupPadding: 0
     popupAlignment: Cura.ExpandableComponent.PopupAlignment.AlignLeft
@@ -25,15 +26,24 @@ Cura.ExpandableComponent
         name: "cura"
     }
 
-    headerItem: Label
+    headerItem: Cura.IconLabel
     {
         text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
-        verticalAlignment: Text.AlignVCenter
-        height: parent.height
-        elide: Text.ElideRight
-        renderType: Text.NativeRendering
-        font: UM.Theme.getFont("default")
+        source:
+        {
+            if (isNetworkPrinter && machineSelector.outputDevice != null)
+            {
+                if (machineSelector.outputDevice.clusterSize > 1)
+                {
+                    return UM.Theme.getIcon("printer_group")
+                }
+                return UM.Theme.getIcon("printer_single")
+            }
+            return ""
+        }
+        font: UM.Theme.getFont("medium")
         color: UM.Theme.getColor("text")
+        iconSize: UM.Theme.getSize("machine_selector_icon").width
     }
 
     popupItem: Item

+ 0 - 0
resources/themes/cura-light/icons/tab_status_connected.svg → resources/themes/cura-light/icons/printer_connected.svg


+ 15 - 7
resources/themes/cura-light/icons/printer_group.svg

@@ -1,12 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<svg width="32px" height="16px" viewBox="0 0 32 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->
-    <title>icn_groupPrinters</title>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
+    <title>Icon/ group printer/ disconnected</title>
     <desc>Created with Sketch.</desc>
-    <defs></defs>
-    <g id="Visual" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="Printer-status-icon" transform="translate(-24.000000, -176.000000)" fill="#000000">
-            <path d="M48,188 L54,188 L54,190 L48,190 L48,188 L48,188 Z M48,180 L54,180 L54,182 L48,182 L48,180 L48,180 Z M54,189 L56,189 L56,191 L54,191 L54,189 L54,189 Z M54,177 L56,177 L56,189 L54,189 L54,177 L54,177 Z M48,182 L51,182 L51,183 L48,183 L48,182 L48,182 Z M49,183 L50,183 L50,185 L49,185 L49,183 L49,183 Z M48,177 L54,177 L54,179 L48,179 L48,177 L48,177 Z M34,176 L46,176 L48,176 L48,187 L53,187 L53,188 L48,188 L48,190 L48,192 L46,192 L46,191 L34,191 L34,192 L32,192 L32,190 L26,190 L26,191 L24,191 L24,189 L24,177 L26,177 L32,177 L32,176 L34,176 Z M34,178 L34,179 L46,179 L46,178 L34,178 Z M41,182 L41,184 L39,184 L39,182 L38,182 L38,181 L42,181 L42,182 L41,182 Z M46,189 L46,181 L34,181 L34,189 L46,189 Z M32,179 L26,179 L26,180 L32,180 L32,179 Z M32,183 L31,183 L31,185 L30,185 L30,183 L29,183 L29,182 L26,182 L26,188 L27,188 L27,187 L32,187 L32,183 Z M35,188 L45,188 L45,189 L35,189 L35,188 Z" id="icn_groupPrinters"></path>
+    <g id="Icon/-group-printer/-disconnected" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Icon/-group-printer/-connected" transform="translate(0.000000, 6.000000)">
+            <g id="printer-group">
+                <path d="M8,16.9319728 L2.15026455,16.9319728 C1.96402116,16.9492063 1.77777778,17.0181406 1.64232804,17.1387755 L1.54074074,17.2421769 C1.43915344,17.4145125 1.23597884,17.4489796 1.03280423,17.4489796 L0.118518519,17.4489796 C0.0677248677,17.4489796 0.0169312169,17.3972789 0.0169312169,17.3455782 L0.0169312169,1.09433107 C0.0169312169,1.04263039 0.0677248677,0.990929705 0.118518519,0.990929705 L8,0.990929705 L8,2.47301587 L1.86243386,2.47301587 C1.67619048,2.47301587 1.54074074,2.62811791 1.54074074,2.80045351 L1.54074074,13.4680272 C1.54074074,13.9505669 1.93015873,14.3469388 2.4042328,14.3469388 L8,14.3469388 L8,16.9319728 Z" id="Combined-Shape" fill="#08073F" fill-rule="nonzero"></path>
+                <g id="UM3" transform="translate(23.777778, 0.904762)"></g>
+                <path d="M24,0.990929705 L31.8814815,0.990929705 C31.9322751,0.990929705 31.9830688,1.04263039 31.9830688,1.09433107 L31.9830688,17.3455782 C31.9830688,17.3972789 31.9322751,17.4489796 31.8814815,17.4489796 L30.9671958,17.4489796 C30.7809524,17.431746 30.594709,17.3628118 30.4592593,17.2421769 L30.357672,17.1387755 C30.2560847,16.9664399 30.0529101,16.9319728 29.8497354,16.9319728 L24,16.9319728 L24,14.3469388 L29.5619048,14.3469388 C30.0359788,14.3469388 30.4253968,13.9505669 30.4253968,13.4680272 L30.442328,13.4680272 L30.442328,2.80045351 C30.442328,2.61088435 30.2899471,2.47301587 30.1206349,2.47301587 L24,2.47301587 L24,0.990929705 Z" id="Combined-Shape" fill="#08073F" fill-rule="nonzero"></path>
+                <g id="Group-Copy-2" transform="translate(8.000000, 0.000000)" fill="#08073F" fill-rule="nonzero">
+                    <g id="UM3" transform="translate(0.000000, 0.000000)">
+                        <path d="M15.8666667,0.0969387755 L0.133333333,0.0969387755 C0.0761904762,0.0969387755 0.019047619,0.155102041 0.019047619,0.213265306 L0.019047619,18.4959184 C0.019047619,18.5540816 0.0761904762,18.6122449 0.133333333,18.6122449 L1.16190476,18.6122449 C1.39047619,18.6122449 1.61904762,18.5734694 1.73333333,18.3795918 L1.84761905,18.2632653 C2,18.127551 2.20952381,18.05 2.41904762,18.0306122 L13.5809524,18.0306122 C13.8095238,18.0306122 14.0380952,18.0693878 14.152381,18.2632653 L14.2666667,18.3795918 C14.4190476,18.5153061 14.6285714,18.5928571 14.8380952,18.6122449 L15.8666667,18.6122449 C15.9238095,18.6122449 15.9809524,18.5540816 15.9809524,18.4959184 L15.9809524,0.213265306 C15.9809524,0.155102041 15.9238095,0.0969387755 15.8666667,0.0969387755 Z M14.2285714,14.1336735 C14.2285714,14.6765306 13.7904762,15.122449 13.2571429,15.122449 L2.7047619,15.122449 C2.17142857,15.122449 1.73333333,14.6765306 1.73333333,14.1336735 L1.73333333,2.13265306 C1.73333333,1.93877551 1.88571429,1.76428571 2.0952381,1.76428571 L13.8857143,1.76428571 C14.0761905,1.76428571 14.247619,1.91938776 14.247619,2.13265306 L14.247619,14.1336735 L14.2285714,14.1336735 Z" id="Shape"></path>
+                    </g>
+                </g>
+            </g>
         </g>
     </g>
 </svg>

+ 7 - 8
resources/themes/cura-light/icons/printer_single.svg

@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->
-    <title>icn_singlePrinter</title>
+<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
+    <title>Icon/ single printer/ disconnected</title>
     <desc>Created with Sketch.</desc>
-    <defs></defs>
-    <g id="Visual" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="Printer-status-icon" transform="translate(-217.000000, -176.000000)" fill="#000000">
-            <g id="icn_singlePrinter" transform="translate(217.000000, 176.000000)">
-                <path d="M2,13 L14,13 L14,15 L2,15 L2,13 L2,13 Z M2,3 L14,3 L14,5 L2,5 L2,3 L2,3 Z M0,14 L2,14 L2,16 L0,16 L0,14 L0,14 Z M14,14 L16,14 L16,16 L14,16 L14,14 L14,14 Z M0,0 L2,0 L2,14 L0,14 L0,0 L0,0 Z M14,0 L16,0 L16,14 L14,14 L14,0 L14,0 Z M6,5 L10,5 L10,6 L6,6 L6,5 L6,5 Z M7,6 L9,6 L9,8 L7,8 L7,6 L7,6 Z M2,0 L14,0 L14,2 L2,2 L2,0 L2,0 Z M3,12 L13,12 L13,13 L3,13 L3,12 L3,12 Z" id="Rectangle-185-Copy-5-Copy-4"></path>
+    <g id="Icon/-single-printer/-disconnected" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Group-Copy-7" transform="translate(6.000000, 5.000000)" fill="#08073F" fill-rule="nonzero">
+            <g id="UM3" transform="translate(0.000000, 0.000000)">
+                <path d="M19.8333333,0.119047619 L0.166666667,0.119047619 C0.0952380952,0.119047619 0.0238095238,0.19047619 0.0238095238,0.261904762 L0.0238095238,22.7142857 C0.0238095238,22.7857143 0.0952380952,22.8571429 0.166666667,22.8571429 L1.45238095,22.8571429 C1.73809524,22.8571429 2.02380952,22.8095238 2.16666667,22.5714286 L2.30952381,22.4285714 C2.5,22.2619048 2.76190476,22.1666667 3.02380952,22.1428571 L16.9761905,22.1428571 C17.2619048,22.1428571 17.547619,22.1904762 17.6904762,22.4285714 L17.8333333,22.5714286 C18.0238095,22.7380952 18.2857143,22.8333333 18.547619,22.8571429 L19.8333333,22.8571429 C19.9047619,22.8571429 19.9761905,22.7857143 19.9761905,22.7142857 L19.9761905,0.261904762 C19.9761905,0.19047619 19.9047619,0.119047619 19.8333333,0.119047619 Z M17.7857143,17.3571429 C17.7857143,18.0238095 17.2380952,18.5714286 16.5714286,18.5714286 L3.38095238,18.5714286 C2.71428571,18.5714286 2.16666667,18.0238095 2.16666667,17.3571429 L2.16666667,2.61904762 C2.16666667,2.38095238 2.35714286,2.16666667 2.61904762,2.16666667 L17.3571429,2.16666667 C17.5952381,2.16666667 17.8095238,2.35714286 17.8095238,2.61904762 L17.8095238,17.3571429 L17.7857143,17.3571429 Z" id="Shape"></path>
             </g>
         </g>
     </g>

+ 0 - 13
resources/themes/cura-light/icons/tab_status_busy.svg

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
-    <title>Busy</title>
-    <desc>Created with Sketch.</desc>
-    <defs></defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="00-printer-status-overview" transform="translate(-17.000000, -22.000000)"></g>
-        <g id="Busy" fill="#D8D8D8">
-            <path d="M7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 Z M9.5,7 C9.5,7.83420277 10.1715729,8.5 11,8.5 C11.8342028,8.5 12.5,7.82842712 12.5,7 C12.5,6.16579723 11.8284271,5.5 11,5.5 C10.1657972,5.5 9.5,6.17157288 9.5,7 Z M1.5,7 C1.5,7.83420277 2.17157288,8.5 3,8.5 C3.83420277,8.5 4.5,7.82842712 4.5,7 C4.5,6.16579723 3.82842712,5.5 3,5.5 C2.16579723,5.5 1.5,6.17157288 1.5,7 Z M5.5,7 C5.5,7.83420277 6.17157288,8.5 7,8.5 C7.83420277,8.5 8.5,7.82842712 8.5,7 C8.5,6.16579723 7.82842712,5.5 7,5.5 C6.16579723,5.5 5.5,6.17157288 5.5,7 Z" id="Combined-Shape"></path>
-        </g>
-    </g>
-</svg>

+ 0 - 13
resources/themes/cura-light/icons/tab_status_finished.svg

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
-    <title>Wait cleanup</title>
-    <desc>Created with Sketch.</desc>
-    <defs></defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="00-printer-status-overview" transform="translate(-84.000000, -22.000000)"></g>
-        <g id="Wait-cleanup" fill="#7FDB16">
-            <path d="M7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 Z M8.07520384,11.2263517 L8.07520384,10.7137766 C8.07520384,10.2581543 7.84739269,10.0018668 7.36329399,10.0018668 L6.73681332,10.0018668 C6.28119101,10.0018668 6.02490346,10.2296779 6.02490346,10.7137766 L6.02490346,11.2263517 C6.02490346,11.681974 6.25271461,11.9382616 6.73681332,11.9382616 L7.36329399,11.9382616 C7.8189163,11.9382616 8.07520384,11.7104504 8.07520384,11.2263517 Z M8.04672745,7.78070802 L8.21758581,2.74038625 C8.21758581,2.25628755 7.98977466,2 7.50567596,2 L6.59443134,2 C6.11033264,2 5.88252149,2.25628755 5.88252149,2.74038625 L6.05337986,7.78070802 C6.08185625,8.23633033 6.3381438,8.49261788 6.7937661,8.49261788 L7.3063412,8.49261788 C7.76196351,8.49261788 8.04672745,8.23633033 8.04672745,7.78070802 Z" id="Combined-Shape"></path>
-        </g>
-    </g>
-</svg>

+ 0 - 13
resources/themes/cura-light/icons/tab_status_paused.svg

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
-    <title>paused</title>
-    <desc>Created with Sketch.</desc>
-    <defs></defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g id="00-printer-status-overview" transform="translate(-246.000000, -22.000000)"></g>
-        <g id="paused" fill="#F5A623">
-            <path d="M7,14 C3.13400675,14 0,10.8659932 0,7 C0,3.13400675 3.13400675,0 7,0 C10.8659932,0 14,3.13400675 14,7 C14,10.8659932 10.8659932,14 7,14 Z M4.33333333,4.11111111 L4.33333333,9.88888889 L6.11111111,9.88888889 L6.11111111,4.11111111 L4.33333333,4.11111111 Z M7.88888889,4.11111111 L7.88888889,9.88888889 L9.66666667,9.88888889 L9.66666667,4.11111111 L7.88888889,4.11111111 Z" id="Combined-Shape"></path>
-        </g>
-    </g>
-</svg>

Some files were not shown because too many files changed in this diff