Browse Source

Don't show camera icon unless printer details are expanded

Contributes to CL-1063
Ian Paschal 6 years ago
parent
commit
1ba8eff7fa

+ 13 - 42
plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml

@@ -36,7 +36,7 @@ Item {
                 return UM.Theme.getColor("monitor_card_background");
             }
         }
-        height: childrenRect.height + UM.Theme.getSize("default_margin").height;
+        height: childrenRect.height;
         layer.effect: DropShadow {
             radius: root.shadowRadius;
             verticalOffset: root.shadowOffset;
@@ -47,29 +47,25 @@ Item {
 
         Column {
             id: cardContents;
-            anchors {
-                top: parent.top;
-                topMargin: UM.Theme.getSize("default_margin").height;
-            }
             height: childrenRect.height;
             width: parent.width;
-            spacing: UM.Theme.getSize("default_margin").height;
 
             // Main card
             Item {
                 id: mainCard;
-                height: 60 * screenScaleFactor;
+                anchors {
+                    left: parent.left;
+                    leftMargin: UM.Theme.getSize("default_margin").width;
+                    right: parent.right;
+                    rightMargin: UM.Theme.getSize("default_margin").width;
+                }
+                height: 60 * screenScaleFactor + 2 * UM.Theme.getSize("default_margin").height;
                 width: parent.width;
 
                 // Machine icon
                 Item {
                     id: machineIcon;
-                    anchors {
-                        leftMargin: UM.Theme.getSize("wide_margin").width;
-                        top: parent.top;
-                        left: parent.left;
-                        margins: UM.Theme.getSize("default_margin").width;
-                    }
+                    anchors.verticalCenter: parent.verticalCenter;
                     height: parent.height - 2 * UM.Theme.getSize("default_margin").width;
                     width: height;
 
@@ -228,17 +224,6 @@ Item {
                     }
                 }
             }
-
-            HorizontalLine {
-                anchors {
-                    left: parent.left;
-                    leftMargin: UM.Theme.getSize("default_margin").width;
-                    right: parent.right;
-                    rightMargin: UM.Theme.getSize("default_margin").width;
-                }
-                visible: root.printer;
-            }
-
             // Detailed card
             PrinterCardDetails {
                 collapsed: root.collapsed;
@@ -246,25 +231,11 @@ Item {
                 visible: root.printer;
             }
 
-            CameraButton {
-                id: showCameraButton;
-                anchors {
-                    left: parent.left;
-                    leftMargin: UM.Theme.getSize("default_margin").width;
-                }
-                iconSource: "../svg/camera-icon.svg";
-                visible: root.printer && root.printJob;
-            }
-        }
-
-        // Progress bar
-        PrinterCardProgressBar {
-            anchors {
-                top: cardContents.bottom;
-                topMargin: UM.Theme.getSize("default_margin").height;
+            // Progress bar
+            PrinterCardProgressBar {
+                visible: printer && printer.activePrintJob != null;
+                width: parent.width;
             }
-            visible: printer && printer.activePrintJob != null;
-            width: parent.width;
         }
     }
 }

+ 10 - 4
plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml

@@ -28,18 +28,18 @@ Item {
             right: parent.right;
             rightMargin: UM.Theme.getSize("default_margin").width;
         }
-        height: childrenRect.height + UM.Theme.getSize("wide_margin").height;
+        height: childrenRect.height + UM.Theme.getSize("default_margin").height;
         spacing: UM.Theme.getSize("default_margin").height;
         width: parent.width;
 
+        HorizontalLine {}
+
         PrinterInfoBlock {
             printer: root.printer;
             printJob: root.printer ? root.printer.activePrintJob : null;
         }
 
-        HorizontalLine {
-            visible: root.printJob;
-        }
+        HorizontalLine {}
 
         Row {
             height: childrenRect.height;
@@ -65,5 +65,11 @@ Item {
             job: root.printer && root.printer.activePrintJob ? root.printer.activePrintJob : null;
             visible: root.printJob;
         }
+
+        CameraButton {
+            id: showCameraButton;
+            iconSource: "../svg/camera-icon.svg";
+            visible: root.printer;
+        }
     }
 }