From 687cdcc30ea4c74dc02e5012f82c445c105b87e7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Feb 2017 13:54:37 +0100 Subject: [PATCH] Add grey border between extruder boxes This is done by fitting tightly a rectangle around the grid of boxes. The boxes themselves have a white background but there is spacing between the boxes, which results in the little border. Contributes to issue CURA-3161. --- resources/qml/PrintMonitor.qml | 65 +++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 556f500348..2db524a794 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -68,41 +68,48 @@ Column } } - GridLayout + Rectangle { - id: extrudersGrid - columns: 2 - columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width - rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height + color: UM.Theme.getColor("sidebar_lining") width: parent.width + height: childrenRect.height - Repeater + GridLayout { - model: machineExtruderCount.properties.value - delegate: Rectangle - { - id: extruderRectangle - color: UM.Theme.getColor("sidebar") - width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2 - height: UM.Theme.getSize("sidebar_extruder_box").height + id: extrudersGrid + columns: 2 + columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width + rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height + width: parent.width - Text //Extruder name. + Repeater + { + model: machineExtruderCount.properties.value + delegate: Rectangle { - text: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend") - color: UM.Theme.getColor("text") - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors.top: parent.top - anchors.topMargin: UM.Theme.getSize("default_margin").height - } - Text //Temperature indication. - { - text: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : "" - font: UM.Theme.getFont("large") - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_margin").width - anchors.top: parent.top - anchors.topMargin: UM.Theme.getSize("default_margin").height + id: extruderRectangle + color: UM.Theme.getColor("sidebar") + width: extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2 + height: UM.Theme.getSize("sidebar_extruder_box").height + + Text //Extruder name. + { + text: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend") + color: UM.Theme.getColor("text") + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("default_margin").height + } + Text //Temperature indication. + { + text: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : "" + font: UM.Theme.getFont("large") + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("default_margin").height + } } } }