From 1ba8eff7fadc2f3e2726002d93ca42d4e34d0a77 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 31 Oct 2018 13:52:31 +0100 Subject: [PATCH] Don't show camera icon unless printer details are expanded Contributes to CL-1063 --- .../resources/qml/PrinterCard.qml | 55 +++++-------------- .../resources/qml/PrinterCardDetails.qml | 14 +++-- 2 files changed, 23 insertions(+), 46 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml index 6c6df7d7fb..24beaf70fe 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml +++ b/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 { + visible: printer && printer.activePrintJob != null; + width: parent.width; } } - - // Progress bar - PrinterCardProgressBar { - anchors { - top: cardContents.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - } - visible: printer && printer.activePrintJob != null; - width: parent.width; - } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml index 097bd5c7a6..31da388b00 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml +++ b/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; + } } }