From 9546c85967492ef46c73a277748238a190fc68e0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Feb 2017 13:50:17 +0100 Subject: [PATCH] Add boxes containing information on extruders These are meant to eventually replace the bullet-list of information we currently have. Contributes to issue CURA-3161. --- .../NetworkPrinterOutputDevice.py | 2 +- resources/qml/PrintMonitor.qml | 42 ++++++++++++++++++- resources/themes/cura/theme.json | 6 +++ 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index c1e75e6181..32ebd354ee 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -100,7 +100,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self.setPriority(2) # Make sure the output device gets selected above local file output self.setName(key) - self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "print over network")) + self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network")) self.setDescription(i18n_catalog.i18nc("@properties:tooltip", "Print over network")) self.setIconName("print") diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 97ecfeb46a..556f500348 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -58,7 +58,7 @@ Column { text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.") color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - font: UM.Theme.getFont("default") + font: UM.Theme.getFont("very_small") wrapMode: Text.WordWrap anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width @@ -68,6 +68,46 @@ Column } } + GridLayout + { + id: extrudersGrid + columns: 2 + columnSpacing: UM.Theme.getSize("sidebar_lining_thin").width + rowSpacing: UM.Theme.getSize("sidebar_lining_thin").height + width: parent.width + + Repeater + { + 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 + + 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 + } + } + } + } + Loader { sourceComponent: monitorSection diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 23ebacd7f9..80fe6a3236 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -24,6 +24,10 @@ "bold": true, "family": "Open Sans" }, + "very_small": { + "size": 1.0, + "family": "Open Sans" + }, "button_tooltip": { "size": 1.0, "family": "Open Sans" @@ -247,9 +251,11 @@ "sidebar_header_mode_toggle": [0.0, 2.0], "sidebar_header_mode_tabs": [0.0, 3.0], "sidebar_lining": [0.5, 0.5], + "sidebar_lining_thin": [0.2, 0.2], "sidebar_setup": [0.0, 2.0], "sidebar_tabs": [0.0, 3.5], "sidebar_inputfields": [0.0, 2.0], + "sidebar_extruder_box": [0.0, 4.0], "simple_mode_infill_caption": [0.0, 5.0], "simple_mode_infill_height": [0.0, 8.0],