From c6d614156f1bd492147d9955f841074ae592f8c7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 16:09:16 +0200 Subject: [PATCH 01/45] Move the Cura logo into the top bar Looks ugly there, I think, but the colours will be changed eventually so we'll see. Contributes to issue CURA-4213. --- resources/qml/Cura.qml | 22 ---------------------- resources/qml/Topbar.qml | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 85b17e28a2..d4055f59f8 100755 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -353,28 +353,6 @@ UM.MainWindow action: Cura.Actions.open; } - Image - { - id: logo - anchors - { - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width; - bottom: parent.bottom - bottomMargin: UM.Theme.getSize("default_margin").height; - } - - source: UM.Theme.getImage("logo"); - width: UM.Theme.getSize("logo").width; - height: UM.Theme.getSize("logo").height; - z: -1; - - sourceSize.width: width; - sourceSize.height: height; - } - - - Toolbar { id: toolbar; diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 210b9e1cfa..b66e29cf52 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -29,9 +29,25 @@ Rectangle name:"cura" } + Image + { + id: logo + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: parent.verticalCenter + + source: UM.Theme.getImage("logo"); + width: UM.Theme.getSize("logo").width; + height: UM.Theme.getSize("logo").height; + + sourceSize.width: width; + sourceSize.height: height; + } + Row { - anchors.left: parent.left + anchors.left: logo.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.right: machineSelection.left anchors.rightMargin: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width From bec786b140f1f4671516373e6b37df605e0642e9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 17:13:56 +0200 Subject: [PATCH 02/45] Move printer status icon outside of the monitor button It's positioned on the right side now above the side bar. Contributes to issue CURA-4213. --- resources/qml/Topbar.qml | 163 ++++++++++++++++++++++----------------- 1 file changed, 91 insertions(+), 72 deletions(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index b66e29cf52..d97b6fc10f 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -57,7 +57,6 @@ Rectangle id: showSettings height: UM.Theme.getSize("sidebar_header").height onClicked: base.stopMonitoringPrint() - iconSource: UM.Theme.getIcon("tab_settings"); property color overlayColor: "transparent" property string overlayIconSource: "" text: catalog.i18nc("@title:tab","Prepare") @@ -74,76 +73,6 @@ Rectangle height: UM.Theme.getSize("sidebar_header").height onClicked: base.startMonitoringPrint() text: catalog.i18nc("@title:tab", "Monitor") - iconSource: printerConnected ? UM.Theme.getIcon("tab_monitor_with_status") : UM.Theme.getIcon("tab_monitor") - property color overlayColor: - { - if(!printerAcceptsCommands) - { - return UM.Theme.getColor("status_unknown"); - } - - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") - { - return UM.Theme.getColor("status_busy"); - } - switch(Cura.MachineManager.printerOutputDevices[0].jobState) - { - case "printing": - case "pre_print": - case "wait_cleanup": - case "pausing": - case "resuming": - return UM.Theme.getColor("status_busy"); - case "ready": - case "": - return UM.Theme.getColor("status_ready"); - case "paused": - return UM.Theme.getColor("status_paused"); - case "error": - return UM.Theme.getColor("status_stopped"); - case "offline": - return UM.Theme.getColor("status_offline"); - default: - return UM.Theme.getColor("text_reversed"); - } - } - property string overlayIconSource: - { - if(!printerConnected) - { - return ""; - } - else if(!printerAcceptsCommands) - { - return UM.Theme.getIcon("tab_status_unknown"); - } - - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") - { - return UM.Theme.getIcon("tab_status_busy"); - } - - switch(Cura.MachineManager.printerOutputDevices[0].jobState) - { - case "printing": - case "pre_print": - case "wait_cleanup": - case "pausing": - case "resuming": - return UM.Theme.getIcon("tab_status_busy"); - case "ready": - case "": - return UM.Theme.getIcon("tab_status_connected") - case "paused": - return UM.Theme.getIcon("tab_status_paused") - case "error": - return UM.Theme.getIcon("tab_status_stopped") - case "offline": - return UM.Theme.getIcon("tab_status_offline") - default: - return "" - } - } checkable: true checked: base.monitoringPrint @@ -155,12 +84,102 @@ Rectangle ExclusiveGroup { id: sidebarHeaderBarGroup } } + UM.RecolorImage + { + id: machineIcon + width: UM.Theme.getSize("button_icon").width //TODO: Once the light design is merged, the theme defines a different size for the top bar icons. + height: UM.Theme.getSize("button_icon").height + anchors.verticalCenter: parent.verticalCenter + anchors.right: machineSelection.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width //TODO: With the light design comes a different margin here. + + source: printerConnected ? UM.Theme.getIcon("tab_monitor_with_status") : UM.Theme.getIcon("tab_monitor") + } + + UM.RecolorImage + { + id: machineStatusIcon + width: machineIcon.width + height: machineIcon.height + anchors.fill: machineIcon + + source: + { + if(!printerConnected) + { + return ""; + } + else if(!printerAcceptsCommands) + { + return UM.Theme.getIcon("tab_status_unknown"); + } + + if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") + { + return UM.Theme.getIcon("tab_status_busy"); + } + + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": + case "wait_cleanup": + case "pausing": + case "resuming": + return UM.Theme.getIcon("tab_status_busy"); + case "ready": + case "": + return UM.Theme.getIcon("tab_status_connected") + case "paused": + return UM.Theme.getIcon("tab_status_paused") + case "error": + return UM.Theme.getIcon("tab_status_stopped") + case "offline": + return UM.Theme.getIcon("tab_status_offline") + default: + return "" + } + } + color: //TODO: In the light design, this is no longer coloured but takes the colour from the SVG icon. + { + if(!printerAcceptsCommands) + { + return UM.Theme.getColor("status_unknown"); + } + + if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") + { + return UM.Theme.getColor("status_busy"); + } + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": + case "wait_cleanup": + case "pausing": + case "resuming": + return UM.Theme.getColor("status_busy"); + case "ready": + case "": + return UM.Theme.getColor("status_ready"); + case "paused": + return UM.Theme.getColor("status_paused"); + case "error": + return UM.Theme.getColor("status_stopped"); + case "offline": + return UM.Theme.getColor("status_offline"); + default: + return UM.Theme.getColor("text_reversed"); + } + } + } + ToolButton { id: machineSelection text: Cura.MachineManager.activeMachineName - width: UM.Theme.getSize("sidebar").width; + width: UM.Theme.getSize("sidebar").width - machineIcon.width - UM.Theme.getSize("default_margin").width * 2 //TODO: The light design has a different margin here. height: UM.Theme.getSize("sidebar_header").height tooltip: Cura.MachineManager.activeMachineName From d13b693da002ce24eabc8b7107aedede97d43556 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 17:24:12 +0200 Subject: [PATCH 03/45] Hide icons if top bar buttons have no icon Otherwise there's some empty space there and the RecolourImage will colour that space white. Contributes to issue CURA-4213. --- resources/themes/cura/styles.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 30e3ce9ab8..f96c2380c0 100755 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -156,22 +156,23 @@ QtObject { height: Theme.getSize("button_icon").height UM.RecolorImage { + visible: control.iconSource != "" id: icon color: UM.Theme.getColor("text_reversed") opacity: !control.enabled ? 0.2 : 1.0 source: control.iconSource - width: Theme.getSize("button_icon").width + width: visible ? Theme.getSize("button_icon").width : 0 height: Theme.getSize("button_icon").height sourceSize: Theme.getSize("button_icon") } UM.RecolorImage { - visible: control.overlayIconSource != "" + visible: control.overlayIconSource != "" && control.iconSource != "" color: control.overlayColor opacity: !control.enabled ? 0.2 : 1.0 source: control.overlayIconSource - width: Theme.getSize("button_icon").width + width: visible ? Theme.getSize("button_icon").width : 0 height: Theme.getSize("button_icon").height sourceSize: Theme.getSize("button_icon") @@ -180,7 +181,7 @@ QtObject { { text: control.text; anchors.left: icon.right - anchors.leftMargin: Theme.getSize("default_margin").width + anchors.leftMargin: icon.visible ? Theme.getSize("default_margin").width : 0 anchors.verticalCenter: parent.verticalCenter; font: UM.Theme.getFont("large"); color: UM.Theme.getColor("text_reversed") From 28d18d88e5d95acda95f45b6319e6a415f184ea1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 17:30:44 +0200 Subject: [PATCH 04/45] Make top bar buttons smaller Contributes to issue CURA-4213. --- resources/themes/cura/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 7e5f6ae199..a025f15d1d 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -293,7 +293,7 @@ "button_icon": [2.5, 2.5], "button_lining": [0, 0], - "topbar_button": [17, 4], + "topbar_button": [8, 4], "button_tooltip": [1.0, 1.3], "button_tooltip_arrow": [0.25, 0.25], From 31af4b7dde6c74c39dca94978204e749071b3f47 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 31 Aug 2017 17:34:23 +0200 Subject: [PATCH 05/45] Remove unused icon Contributes to issue CURA-4213. --- resources/themes/cura/icons/tab_settings.svg | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 resources/themes/cura/icons/tab_settings.svg diff --git a/resources/themes/cura/icons/tab_settings.svg b/resources/themes/cura/icons/tab_settings.svg deleted file mode 100644 index 0d90db81ef..0000000000 --- a/resources/themes/cura/icons/tab_settings.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - From b174d04a9bd3f2a2e006bd10f5f3efda1662eee0 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 Aug 2017 12:28:31 +0200 Subject: [PATCH 06/45] Add SVG image for extruder button CURA-4211 --- .../themes/cura/icons/extruder_button.svg | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 resources/themes/cura/icons/extruder_button.svg diff --git a/resources/themes/cura/icons/extruder_button.svg b/resources/themes/cura/icons/extruder_button.svg new file mode 100644 index 0000000000..883e3caaf4 --- /dev/null +++ b/resources/themes/cura/icons/extruder_button.svg @@ -0,0 +1,70 @@ + + + + + + image/svg+xml + + Artboard 3 Copy + + + + + + Artboard 3 Copy + Created with Sketch. + + + + From 7de9ccefaa107ceded65e6f9d0da2c6c1dc309c9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 Aug 2017 12:29:44 +0200 Subject: [PATCH 07/45] Change extruder button on the toolbar side CURA-4211 Change the extruder button on the toolbar side according to the new design. --- resources/qml/ExtruderButton.qml | 28 ++++++++++++++-------------- resources/themes/cura/theme.json | 3 +++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index 296964448b..0037207e87 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -16,7 +16,7 @@ Button text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name) style: UM.Theme.styles.tool_button; - iconSource: checked ? UM.Theme.getIcon("material_selected") : UM.Theme.getIcon("material_not_selected"); + iconSource: UM.Theme.getIcon("extruder_button") checked: ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1 enabled: UM.Selection.hasSelection @@ -36,12 +36,7 @@ Button Item { - anchors - { - right: parent.right; - top: parent.top; - margins: UM.Theme.getSize("default_lining").width * 3 - } + anchors.centerIn: parent width: UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("default_margin").height @@ -54,22 +49,27 @@ Button } } + // Material colour circle + // Only draw the filling colour of the material inside the SVG border. Rectangle { anchors { - left: parent.left; - top: parent.top; - margins: UM.Theme.getSize("default_lining").width * 3 + right: parent.right + top: parent.top + margins: UM.Theme.getSize("extruder_button_material_margin").width } color: model.color - width: UM.Theme.getSize("default_margin").width - height: UM.Theme.getSize("default_margin").height + width: UM.Theme.getSize("extruder_button_material_size").width + height: UM.Theme.getSize("extruder_button_material_size").height + radius: width / 2 - border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("lining"); + border.width: 0 + border.color: "transparent" + + opacity: !base.enabled ? 0.2 : 1.0 } onClicked: diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 7e5f6ae199..a81df76676 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -259,6 +259,9 @@ "default_arrow": [0.8, 0.8], "logo": [9.5, 2.0], + "extruder_button_material_margin": [0.875, 0.875], + "extruder_button_material_size": [0.68, 0.68], + "sidebar": [35.0, 10.0], "sidebar_header": [0.0, 4.0], "sidebar_header_highlight": [0.25, 0.25], From b75140973e107f1827b2ac743bc4f107e7d1b503 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 Aug 2017 15:56:07 +0200 Subject: [PATCH 08/45] Change extruder tab to use new button style CURA-4211 - Use new button style ("Extruder" text with an extruder icon) for extruder tabs - The "Extruder" text will disapear if the width is not enough --- resources/qml/SidebarHeader.qml | 114 ++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 36 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 840a7067ce..85929f016e 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -92,49 +92,26 @@ Column style: ButtonStyle { - background: Rectangle + background: Item { - border.width: UM.Theme.getSize("default_lining").width - border.color: control.checked ? UM.Theme.getColor("tab_checked_border") : - control.pressed ? UM.Theme.getColor("tab_active_border") : - control.hovered ? UM.Theme.getColor("tab_hovered_border") : UM.Theme.getColor("tab_unchecked_border") - color: control.checked ? UM.Theme.getColor("tab_checked") : - control.pressed ? UM.Theme.getColor("tab_active") : - control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked") - Behavior on color { ColorAnimation { duration: 50; } } - Rectangle { - id: highlight - visible: control.checked - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - height: UM.Theme.getSize("sidebar_header_highlight").height - color: UM.Theme.getColor("sidebar_header_bar") - } - - Rectangle - { - id: swatch - visible: index > -1 - height: UM.Theme.getSize("setting_control").height / 2 - width: height - anchors.left: parent.left - anchors.leftMargin: (parent.height - height) / 2 - anchors.verticalCenter: parent.verticalCenter - - color: model.color + anchors.fill: parent border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("setting_control_border") + border.color: control.checked ? UM.Theme.getColor("tab_checked_border") : + control.pressed ? UM.Theme.getColor("tab_active_border") : + control.hovered ? UM.Theme.getColor("tab_hovered_border") : UM.Theme.getColor("tab_unchecked_border") + color: control.checked ? UM.Theme.getColor("tab_checked") : + control.pressed ? UM.Theme.getColor("tab_active") : + control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked") + Behavior on color { ColorAnimation { duration: 50; } } } Text { + id: extruderStaticText anchors.verticalCenter: parent.verticalCenter - anchors.left: swatch.visible ? swatch.right : parent.left - anchors.leftMargin: swatch.visible ? UM.Theme.getSize("default_margin").width / 2 : UM.Theme.getSize("default_margin").width - anchors.right: parent.right + anchors.right: parent.horizontalCenter anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2 color: control.checked ? UM.Theme.getColor("tab_checked_text") : @@ -142,11 +119,76 @@ Column control.hovered ? UM.Theme.getColor("tab_hovered_text") : UM.Theme.getColor("tab_unchecked_text") font: UM.Theme.getFont("default") - text: control.text + text: catalog.i18nc("@label", "Extruder") + visible: width < (control.width - UM.Theme.getSize("default_margin").width) / 2 elide: Text.ElideRight } + + Item + { + anchors.verticalCenter: parent.verticalCenter + anchors.left: !extruderStaticText.visible ? parent.left : parent.horizontalCenter + anchors.leftMargin: !extruderStaticText.visible ? (parent.width - width) / 2 : UM.Theme.getSize("default_margin").width / 2 + + property var sizeToUse: + { + var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width; + var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height; + var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight; + minimumSize -= UM.Theme.getSize("default_margin").width; + return minimumSize; + } + + width: sizeToUse + height: sizeToUse + + UM.RecolorImage { + id: mainCircle + anchors.fill: parent + + sourceSize.width: parent.width + sourceSize.height: parent.width + source: UM.Theme.getIcon("extruder_button") + + color: control.checked ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_control_disabled_text") + } + + Text + { + anchors.centerIn: parent + text: index + 1; + color: control.checked ? UM.Theme.getColor("tab_checked_text") : + control.pressed ? UM.Theme.getColor("tab_active_text") : + control.hovered ? UM.Theme.getColor("tab_hovered_text") : UM.Theme.getColor("tab_unchecked_text") + font: UM.Theme.getFont("default_bold") + } + + // Material colour circle + // Only draw the filling colour of the material inside the SVG border. + Rectangle + { + anchors + { + right: parent.right + top: parent.top + rightMargin: parent.sizeToUse * 0.04 + topMargin: parent.sizeToUse * 0.04 + } + + color: model.color + + width: parent.width * 0.27 + height: parent.height * 0.27 + radius: width / 2 + + border.width: 0 + border.color: "transparent" + + opacity: !control.checked ? 0.6 : 1.0 + } + } } - label: Item { } + label: Item {} } } } From c2645d00223c53e126f83deb25fb957b30c3a2ab Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 Aug 2017 17:14:38 +0200 Subject: [PATCH 09/45] Change extruder tabs to buttons CURA-4211 Change extruder tabs to buttons according to the new design. --- resources/qml/SidebarHeader.qml | 193 +++++++++++++++++++------------- 1 file changed, 114 insertions(+), 79 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 85929f016e..b4950a26bc 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -22,6 +22,30 @@ Column signal showTooltip(Item item, point location, string text) signal hideTooltip() + Item + { + height: UM.Theme.getSize("default_margin").height / 4 + width: height + visible: extruderSelectionRow.visible + } + + Label + { + id: extruderSelectionLabel + anchors + { + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + } + height: UM.Theme.getSize("sidebar_tabs").height / 3 + text: catalog.i18nc("@label", "Extruder configuration") + font: UM.Theme.getFont("default_bold") + color: UM.Theme.getColor("text") + visible: extruderSelectionRow.visible + } + Item { id: extruderSelectionRow @@ -29,16 +53,12 @@ Column height: UM.Theme.getSize("sidebar_tabs").height visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint - Rectangle + anchors { - id: extruderSeparator - visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint - - width: parent.width - height: parent.height - color: UM.Theme.getColor("sidebar_lining") - - anchors.top: extruderSelectionRow.top + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width } ListView @@ -53,8 +73,10 @@ Column anchors { left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width / 2 right: parent.right - bottom: extruderSelectionRow.bottom + rightMargin: UM.Theme.getSize("default_margin").width / 2 + verticalCenter: parent.verticalCenter } ExclusiveGroup { id: extruderMenuGroup; } @@ -98,93 +120,106 @@ Column { anchors.fill: parent border.width: UM.Theme.getSize("default_lining").width - border.color: control.checked ? UM.Theme.getColor("tab_checked_border") : - control.pressed ? UM.Theme.getColor("tab_active_border") : - control.hovered ? UM.Theme.getColor("tab_hovered_border") : UM.Theme.getColor("tab_unchecked_border") - color: control.checked ? UM.Theme.getColor("tab_checked") : - control.pressed ? UM.Theme.getColor("tab_active") : - control.hovered ? UM.Theme.getColor("tab_hovered") : UM.Theme.getColor("tab_unchecked") + border.color: control.checked ? UM.Theme.getColor("toggle_checked_border") : + control.pressed ? UM.Theme.getColor("toggle_active_border") : + control.hovered ? UM.Theme.getColor("toggle_hovered_border") : UM.Theme.getColor("toggle_unchecked_border") + color: control.checked ? UM.Theme.getColor("toggle_checked") : + control.pressed ? UM.Theme.getColor("toggle_active") : + control.hovered ? UM.Theme.getColor("toggle_hovered") : UM.Theme.getColor("toggle_unchecked") Behavior on color { ColorAnimation { duration: 50; } } } - Text - { - id: extruderStaticText - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.horizontalCenter - anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2 - - color: control.checked ? UM.Theme.getColor("tab_checked_text") : - control.pressed ? UM.Theme.getColor("tab_active_text") : - control.hovered ? UM.Theme.getColor("tab_hovered_text") : UM.Theme.getColor("tab_unchecked_text") - - font: UM.Theme.getFont("default") - text: catalog.i18nc("@label", "Extruder") - visible: width < (control.width - UM.Theme.getSize("default_margin").width) / 2 - elide: Text.ElideRight - } - Item { - anchors.verticalCenter: parent.verticalCenter - anchors.left: !extruderStaticText.visible ? parent.left : parent.horizontalCenter - anchors.leftMargin: !extruderStaticText.visible ? (parent.width - width) / 2 : UM.Theme.getSize("default_margin").width / 2 - - property var sizeToUse: - { - var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width; - var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height; - var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight; - minimumSize -= UM.Theme.getSize("default_margin").width; - return minimumSize; - } - - width: sizeToUse - height: sizeToUse - - UM.RecolorImage { - id: mainCircle - anchors.fill: parent - - sourceSize.width: parent.width - sourceSize.height: parent.width - source: UM.Theme.getIcon("extruder_button") - - color: control.checked ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_control_disabled_text") + id: extruderButtonFace + anchors.centerIn: parent + width: { + var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0; + var iconWidth = extruderIconItem.width; + return extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 4; } + // Static text "Extruder" Text { - anchors.centerIn: parent - text: index + 1; - color: control.checked ? UM.Theme.getColor("tab_checked_text") : - control.pressed ? UM.Theme.getColor("tab_active_text") : - control.hovered ? UM.Theme.getColor("tab_hovered_text") : UM.Theme.getColor("tab_unchecked_text") - font: UM.Theme.getFont("default_bold") + id: extruderStaticText + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + + color: control.checked ? UM.Theme.getColor("toggle_checked_text") : + control.pressed ? UM.Theme.getColor("toggle_active_text") : + control.hovered ? UM.Theme.getColor("toggle_hovered_text") : UM.Theme.getColor("toggle_unchecked_text") + + font: UM.Theme.getFont("default") + text: catalog.i18nc("@label", "Extruder") + visible: width < (control.width - extruderIconItem.width - UM.Theme.getSize("default_margin").width) + elide: Text.ElideRight } - // Material colour circle - // Only draw the filling colour of the material inside the SVG border. - Rectangle + // Everthing for the extruder icon + Item { - anchors + id: extruderIconItem + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + + property var sizeToUse: { - right: parent.right - top: parent.top - rightMargin: parent.sizeToUse * 0.04 - topMargin: parent.sizeToUse * 0.04 + var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width; + var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height; + var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight; + minimumSize -= UM.Theme.getSize("default_margin").width; + return minimumSize; } - color: model.color + width: sizeToUse + height: sizeToUse - width: parent.width * 0.27 - height: parent.height * 0.27 - radius: width / 2 + UM.RecolorImage { + id: mainCircle + anchors.fill: parent - border.width: 0 - border.color: "transparent" + sourceSize.width: parent.width + sourceSize.height: parent.width + source: UM.Theme.getIcon("extruder_button") - opacity: !control.checked ? 0.6 : 1.0 + color: extruderNumberText.color + } + + Text + { + id: extruderNumberText + anchors.centerIn: parent + text: index + 1; + color: control.checked ? UM.Theme.getColor("toggle_checked_text") : + control.pressed ? UM.Theme.getColor("toggle_active_text") : + control.hovered ? UM.Theme.getColor("toggle_hovered_text") : UM.Theme.getColor("toggle_unchecked_text") + font: UM.Theme.getFont("default_bold") + } + + // Material colour circle + // Only draw the filling colour of the material inside the SVG border. + Rectangle + { + anchors + { + right: parent.right + top: parent.top + rightMargin: parent.sizeToUse * 0.04 + topMargin: parent.sizeToUse * 0.04 + } + + color: model.color + + width: parent.width * 0.27 + height: parent.height * 0.27 + radius: width / 2 + + border.width: 0 + border.color: "transparent" + + opacity: !control.checked ? 0.6 : 1.0 + } } } } From aad628a46fd2850257204dc4c9c0d517b9eb80f9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 31 Aug 2017 17:48:37 +0200 Subject: [PATCH 10/45] Change to new design for extruder number settings CURA-4211 --- resources/qml/Settings/SettingExtruder.qml | 36 ++++++++-------- .../qml/Settings/SettingOptionalExtruder.qml | 42 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 15496eaa8b..ac9f6a29eb 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -97,36 +97,36 @@ SettingItem } label: Item { + Label + { + id: extruderText + anchors.verticalCenter: parent.verticalCenter + + text: control.currentText + font: UM.Theme.getFont("default") + color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") + + elide: Text.ElideLeft + verticalAlignment: Text.AlignVCenter + } Rectangle { id: swatch height: UM.Theme.getSize("setting_control").height / 2 width: height - anchors.verticalCenter: parent.verticalCenter - - border.width: UM.Theme.getSize("default_lining").width - border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - - color: control.color - } - Label - { anchors { - left: swatch.right; - right: arrow.left; + right: arrow.left verticalCenter: parent.verticalCenter - margins: UM.Theme.getSize("default_lining").width + margins: UM.Theme.getSize("default_margin").width / 4 } - width: parent.width - swatch.width; - text: control.currentText - font: UM.Theme.getFont("default") - color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") + border.width: UM.Theme.getSize("default_lining").width * 2 + border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") + radius: width / 2 - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter + color: control.color } UM.RecolorImage { diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 0fd36564a1..4e49f0440e 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -116,29 +116,10 @@ SettingItem } label: Item { - Rectangle - { - id: swatch - height: UM.Theme.getSize("setting_control").height / 2 - width: height - - anchors.verticalCenter: parent.verticalCenter - - border.width: UM.Theme.getSize("default_lining").width - border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - - color: control.color - } Label { - anchors - { - left: swatch.right; - right: arrow.left; - verticalCenter: parent.verticalCenter - margins: UM.Theme.getSize("default_lining").width - } - width: parent.width - swatch.width; + anchors.verticalCenter: parent.verticalCenter + width: parent.width - swatch.width - arrow.width; text: control.currentText font: UM.Theme.getFont("default") @@ -147,6 +128,25 @@ SettingItem elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height + + anchors + { + right: arrow.left; + verticalCenter: parent.verticalCenter + margins: UM.Theme.getSize("default_margin").width / 4 + } + + border.width: UM.Theme.getSize("default_lining").width * 2 + border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") + radius: width / 2 + + color: control.color + } UM.RecolorImage { id: arrow From ab4da4ab360523a220fb3079752e3d26b47864ed Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Sat, 2 Sep 2017 08:40:01 +0100 Subject: [PATCH 11/45] Now layer start X/Y can be < 0 when machine centre is zero. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 4beec290ca..da08f4b472 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2997,7 +2997,7 @@ "unit": "mm", "type": "float", "default_value": 0.0, - "minimum_value": "0", + "minimum_value": "machine_width / -2 if machine_center_is_zero else 0", "settable_per_mesh": false, "settable_per_extruder": true, "settable_per_meshgroup": true @@ -3009,7 +3009,7 @@ "unit": "mm", "type": "float", "default_value": 0.0, - "minimum_value": "0", + "minimum_value": "machine_depth / -2 if machine_center_is_zero else 0", "settable_per_mesh": false, "settable_per_extruder": true, "settable_per_meshgroup": true From 002536976246878e04ed4a56bd8a2fd942367c82 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 08:30:59 +0200 Subject: [PATCH 12/45] Remove old extruder material icons CURA-4211 --- .../icons/material_not_selected.svg | 77 ------------------ .../cura-light/icons/material_selected.svg | 78 ------------------- 2 files changed, 155 deletions(-) delete mode 100644 resources/themes/cura-light/icons/material_not_selected.svg delete mode 100644 resources/themes/cura-light/icons/material_selected.svg diff --git a/resources/themes/cura-light/icons/material_not_selected.svg b/resources/themes/cura-light/icons/material_not_selected.svg deleted file mode 100644 index 9b3cad88bd..0000000000 --- a/resources/themes/cura-light/icons/material_not_selected.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - image/svg+xml - - Artboard 3 - - - - - - Artboard 3 - Created with Sketch. - - - - - - - - - - diff --git a/resources/themes/cura-light/icons/material_selected.svg b/resources/themes/cura-light/icons/material_selected.svg deleted file mode 100644 index 6589eac416..0000000000 --- a/resources/themes/cura-light/icons/material_selected.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - image/svg+xml - - Artboard 3 Copy - - - - - - Artboard 3 Copy - Created with Sketch. - - - - - - - - - - From 8e774dede46ff43652213b8cc12de8b118bfc5d1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 08:42:44 +0200 Subject: [PATCH 13/45] Change extruder combobox style for simple mode CURA-4211 --- resources/themes/cura-light/styles.qml | 35 +++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 2d40a0e8d0..afc1df1d5b 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -612,24 +612,11 @@ QtObject { } label: Item { - Rectangle - { - id: swatch - height: UM.Theme.getSize("setting_control").height / 2 - width: height - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter - - color: if (control.color_override != "") {return control.color_override} else {return control.color;} - border.width: UM.Theme.getSize("default_lining").width - border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") - } Label { - anchors.left: swatch.right + anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left + anchors.right: swatch.left anchors.rightMargin: UM.Theme.getSize("default_lining").width anchors.verticalCenter: parent.verticalCenter @@ -640,7 +627,25 @@ QtObject { elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height + anchors + { + right: downArrow.left; + verticalCenter: parent.verticalCenter + margins: UM.Theme.getSize("default_margin").width / 4 + } + + border.width: UM.Theme.getSize("default_lining").width * 2 + border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") + radius: width / 2 + + color: if (control.color_override != "") {return control.color_override} else {return control.color;} + } UM.RecolorImage { id: downArrow From 88c74b30c2f322d9a3b2f4232a461879af25a9e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 4 Sep 2017 11:48:54 +0200 Subject: [PATCH 14/45] Added missing QML properties --- resources/qml/Topbar.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index d97b6fc10f..bec159e6c5 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -73,7 +73,8 @@ Rectangle height: UM.Theme.getSize("sidebar_header").height onClicked: base.startMonitoringPrint() text: catalog.i18nc("@title:tab", "Monitor") - + property color overlayColor: "transparent" + property string overlayIconSource: "" checkable: true checked: base.monitoringPrint exclusiveGroup: sidebarHeaderBarGroup From 1b66eaea22837e317ef9641800652c10c60e30a2 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 12:14:16 +0200 Subject: [PATCH 15/45] Move extruder button sizes to cura-light theme CURA-4211 --- resources/themes/cura-light/theme.json | 3 +++ resources/themes/cura/theme.json | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index eb9fb72db6..c8a9faf2a2 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -261,6 +261,9 @@ "default_arrow": [0.8, 0.8], "logo": [9.5, 2.0], + "extruder_button_material_margin": [0.875, 0.875], + "extruder_button_material_size": [0.68, 0.68], + "sidebar": [35.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index ce93c05568..3ef5366c9e 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -209,9 +209,6 @@ "default_arrow": [0.8, 0.8], "logo": [9.5, 2.0], - "extruder_button_material_margin": [0.875, 0.875], - "extruder_button_material_size": [0.68, 0.68], - "sidebar": [35.0, 10.0], "sidebar_header": [0.0, 4.0], "sidebar_header_highlight": [0.25, 0.25], From 7e60d459b4c1b7001e7faa50892857f15a53ab9c Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 4 Sep 2017 15:47:44 +0200 Subject: [PATCH 16/45] Prevent a possible memory leak while showing a stuck camera stream --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 96c511bccb..4eaaf4e412 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -326,6 +326,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): return True def _stopCamera(self): + self._stream_buffer = b"" + self._stream_buffer_start_index = -1 + if self._camera_timer.isActive(): self._camera_timer.stop() if self._image_reply: @@ -1165,6 +1168,12 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): return self._stream_buffer += self._image_reply.readAll() + if len(self._stream_buffer) > 2000000: # No single camera frame should be 2 Mb or larger + Logger.log("w", "MJPEG buffer exceeds reasonable size. Restarting stream...") + self._stopCamera() # resets stream buffer and start index + self._startCamera() + return + if self._stream_buffer_start_index == -1: self._stream_buffer_start_index = self._stream_buffer.indexOf(b'\xff\xd8') stream_buffer_end_index = self._stream_buffer.lastIndexOf(b'\xff\xd9') From f803e72c188af901eb57f917f723522e9b7ea5b3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 17:25:23 +0200 Subject: [PATCH 17/45] Use Screen.devicePixelRatio for plugin browser CURA-4279 --- plugins/PluginBrowser/PluginBrowser.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/PluginBrowser/PluginBrowser.qml b/plugins/PluginBrowser/PluginBrowser.qml index 494e09e26b..f8a4001443 100644 --- a/plugins/PluginBrowser/PluginBrowser.qml +++ b/plugins/PluginBrowser/PluginBrowser.qml @@ -9,10 +9,10 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Find & Update plugins") - width: 600 - height: 450 - minimumWidth: 350 - minimumHeight: 350 + width: 600 * Screen.devicePixelRatio + height: 450 * Screen.devicePixelRatio + minimumWidth: 350 * Screen.devicePixelRatio + minimumHeight: 350 * Screen.devicePixelRatio Item { anchors.fill: parent From 4249274af0f46ed473dd5e78654a6d27ce5d2ab4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 17:25:56 +0200 Subject: [PATCH 18/45] Move license window size to light theme CURA-4279 The light theme is now the default and it's a base theme, so the window size needs to be there. --- resources/themes/cura-light/theme.json | 1 + resources/themes/cura/theme.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index eb9fb72db6..00f8bcd2b8 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -332,6 +332,7 @@ "save_button_specs_icons": [1.4, 1.4], "modal_window_minimum": [60.0, 45], + "license_window_minimum": [45, 45], "wizard_progress": [10.0, 0.0], "message": [30.0, 5.0], diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 3ef5366c9e..3f9d98b5b4 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -278,7 +278,6 @@ "save_button_specs_icons": [1.4, 1.4], "modal_window_minimum": [60.0, 45], - "license_window_minimum": [45, 45], "wizard_progress": [10.0, 0.0], "message": [30.0, 5.0], From 08766ee66f061ab35766b30199375ac0d966580f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 4 Sep 2017 17:36:44 +0200 Subject: [PATCH 19/45] Fix wrong indentation for camera view --- .../NetworkPrinterOutputDevice.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 96c511bccb..5e384d1d03 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -328,14 +328,15 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): def _stopCamera(self): if self._camera_timer.isActive(): self._camera_timer.stop() - if self._image_reply: - try: - self._image_reply.abort() - self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) - except RuntimeError: - pass # It can happen that the wrapped c++ object is already deleted. - self._image_reply = None - self._image_request = None + + if self._image_reply: + try: + self._image_reply.abort() + self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) + except RuntimeError: + pass # It can happen that the wrapped c++ object is already deleted. + self._image_reply = None + self._image_request = None def _startCamera(self): if self._use_stream: From 90240af80f40068a639509ecc3cef14d22557abb Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 07:54:20 +0200 Subject: [PATCH 20/45] Correct stdout and stderr redirect location on Mac --- cura_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 2e406f99d3..ef9190a1fe 100755 --- a/cura_app.py +++ b/cura_app.py @@ -60,7 +60,7 @@ def get_cura_dir_path(): elif Platform.isLinux(): return os.path.expanduser("~/.local/share/cura") elif Platform.isOSX(): - return os.path.expanduser("~/Library/Application Support/cura") + return os.path.expanduser("~/Library/Logs/cura") if hasattr(sys, "frozen"): From e44aedc4b9ebe45106dc8169fc80db8aa652274c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 10:56:55 +0200 Subject: [PATCH 21/45] Make logo smaller CURA-4213 --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a28833903e..1f5b231d27 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -259,7 +259,7 @@ "default_margin": [1.0, 1.0], "default_lining": [0.08, 0.08], "default_arrow": [0.8, 0.8], - "logo": [9.5, 2.0], + "logo": [7.6, 1.6], "sidebar": [35.0, 10.0], "sidebar_margin": [1.71, 1.43], From afb885015572f0c715cc4ea72f67cade7b490b2c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 10:58:28 +0200 Subject: [PATCH 22/45] Update topbar button style CURA-4213 --- resources/themes/cura-light/styles.qml | 6 +++--- resources/themes/cura-light/theme.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index b51d4159d9..57c08ca9d6 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -116,10 +116,10 @@ QtObject { Rectangle { id: underline; - anchors.left: parent.left - anchors.right: parent.right + anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - height: UM.Theme.getSize("sidebar_header_highlight").height + width: Theme.getSize("topbar_button").width + height: Theme.getSize("sidebar_header_highlight").height color: control.checked ? UM.Theme.getColor("sidebar_header_highlight") : UM.Theme.getColor("sidebar_header_highlight_hover") visible: control.hovered || control.checked } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 1f5b231d27..6d666b6413 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -297,6 +297,7 @@ "button_icon": [2.5, 2.5], "button_lining": [0, 0], + "topbar_logo_right_margin": [3, 0], "topbar_button": [8, 4], "topbar_button_icon": [3.125, 2.5], From 3e3f15d33f0a9f301f5fe61e136f64ed593ef985 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 10:59:12 +0200 Subject: [PATCH 23/45] Larger gap between the logo and topbar buttons CURA-4213 --- resources/qml/Topbar.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 91f7b36bb5..7baeb002f1 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -47,7 +47,7 @@ Rectangle Row { anchors.left: logo.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.leftMargin: UM.Theme.getSize("topbar_logo_right_margin").width anchors.right: machineSelection.left anchors.rightMargin: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width From 3f6f4a129165d0f389fbb1e01261f6c7621320e0 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 11:10:47 +0200 Subject: [PATCH 24/45] Fix merge conflict for topbar monitor button CURA-4106 --- resources/qml/Topbar.qml | 162 +++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 92 deletions(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 7baeb002f1..3fd7baef1c 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -73,8 +73,75 @@ Rectangle height: UM.Theme.getSize("sidebar_header").height onClicked: base.startMonitoringPrint() text: catalog.i18nc("@title:tab", "Monitor") - property color overlayColor: "transparent" - property string overlayIconSource: "" + iconSource: UM.Theme.getIcon("tab_monitor") + property color overlayColor: + { + if(!printerAcceptsCommands) + { + return UM.Theme.getColor("status_unknown"); + } + + if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") + { + return UM.Theme.getColor("status_busy"); + } + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": + case "wait_cleanup": + case "pausing": + case "resuming": + return UM.Theme.getColor("status_busy"); + case "ready": + case "": + return UM.Theme.getColor("status_ready"); + case "paused": + return UM.Theme.getColor("status_paused"); + case "error": + return UM.Theme.getColor("status_stopped"); + case "offline": + return UM.Theme.getColor("status_offline"); + default: + return UM.Theme.getColor("text_reversed"); + } + } + property string overlayIconSource: + { + if(!printerConnected) + { + return ""; + } + else if(!printerAcceptsCommands) + { + return UM.Theme.getIcon("tab_status_unknown"); + } + + if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") + { + return UM.Theme.getIcon("tab_status_busy"); + } + + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": + case "wait_cleanup": + case "pausing": + case "resuming": + return UM.Theme.getIcon("tab_status_busy"); + case "ready": + case "": + return UM.Theme.getIcon("tab_status_connected") + case "paused": + return UM.Theme.getIcon("tab_status_paused") + case "error": + return UM.Theme.getIcon("tab_status_stopped") + default: + return "" + } + } + checkable: true checked: base.monitoringPrint exclusiveGroup: sidebarHeaderBarGroup @@ -85,102 +152,13 @@ Rectangle ExclusiveGroup { id: sidebarHeaderBarGroup } } - UM.RecolorImage - { - id: machineIcon - width: UM.Theme.getSize("button_icon").width //TODO: Once the light design is merged, the theme defines a different size for the top bar icons. - height: UM.Theme.getSize("button_icon").height - anchors.verticalCenter: parent.verticalCenter - anchors.right: machineSelection.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width //TODO: With the light design comes a different margin here. - - source: printerConnected ? UM.Theme.getIcon("tab_monitor_with_status") : UM.Theme.getIcon("tab_monitor") - } - - UM.RecolorImage - { - id: machineStatusIcon - width: machineIcon.width - height: machineIcon.height - anchors.fill: machineIcon - - source: - { - if(!printerConnected) - { - return ""; - } - else if(!printerAcceptsCommands) - { - return UM.Theme.getIcon("tab_status_unknown"); - } - - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") - { - return UM.Theme.getIcon("tab_status_busy"); - } - - switch(Cura.MachineManager.printerOutputDevices[0].jobState) - { - case "printing": - case "pre_print": - case "wait_cleanup": - case "pausing": - case "resuming": - return UM.Theme.getIcon("tab_status_busy"); - case "ready": - case "": - return UM.Theme.getIcon("tab_status_connected") - case "paused": - return UM.Theme.getIcon("tab_status_paused") - case "error": - return UM.Theme.getIcon("tab_status_stopped") - case "offline": - return UM.Theme.getIcon("tab_status_offline") - default: - return "" - } - } - color: //TODO: In the light design, this is no longer coloured but takes the colour from the SVG icon. - { - if(!printerAcceptsCommands) - { - return UM.Theme.getColor("status_unknown"); - } - - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") - { - return UM.Theme.getColor("status_busy"); - } - switch(Cura.MachineManager.printerOutputDevices[0].jobState) - { - case "printing": - case "pre_print": - case "wait_cleanup": - case "pausing": - case "resuming": - return UM.Theme.getColor("status_busy"); - case "ready": - case "": - return UM.Theme.getColor("status_ready"); - case "paused": - return UM.Theme.getColor("status_paused"); - case "error": - return UM.Theme.getColor("status_stopped"); - case "offline": - return UM.Theme.getColor("status_offline"); - default: - return UM.Theme.getColor("text_reversed"); - } - } - } ToolButton { id: machineSelection text: Cura.MachineManager.activeMachineName - width: UM.Theme.getSize("sidebar").width - machineIcon.width - UM.Theme.getSize("default_margin").width * 2 //TODO: The light design has a different margin here. + width: UM.Theme.getSize("sidebar").width height: UM.Theme.getSize("sidebar_header").height tooltip: Cura.MachineManager.activeMachineName From 4b08a5611a8c7523f12b39cf67ab1a3812e68858 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 11:37:03 +0200 Subject: [PATCH 25/45] Make topbar transparent and update text style CURA-4213 --- resources/qml/Topbar.qml | 2 +- resources/themes/cura-light/styles.qml | 18 +++++------------- resources/themes/cura-light/theme.json | 8 ++++++++ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 3fd7baef1c..e29b9abf86 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -16,7 +16,7 @@ Rectangle anchors.left: parent.left anchors.right: parent.right height: UM.Theme.getSize("sidebar_header").height - color: UM.Theme.getColor("sidebar_header_bar") + color: "transparent" property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 57c08ca9d6..cfe35ca789 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -102,15 +102,7 @@ QtObject { anchors.fill: parent; property bool down: control.pressed || (control.checkable && control.checked); - color: { - if(control.pressed || (control.checkable && control.checked)) { - return Theme.getColor("sidebar_header_active"); - } else if(control.hovered) { - return Theme.getColor("sidebar_header_hover"); - } else { - return Theme.getColor("sidebar_header_bar"); - } - } + color: "transparent" Behavior on color { ColorAnimation { duration: 50; } } Rectangle { @@ -165,20 +157,20 @@ QtObject { anchors.left: icon.right anchors.leftMargin: icon.visible ? Theme.getSize("default_margin").width : 0 anchors.verticalCenter: parent.verticalCenter; - font: UM.Theme.getFont("large"); + font: control.checked ? UM.Theme.getFont("large") : UM.Theme.getFont("large_nonbold") color: { if(control.hovered) { - return UM.Theme.getColor("sidebar_header_text_hover"); + return UM.Theme.getColor("topbar_button_text_hovered"); } if(control.checked) { - return UM.Theme.getColor("sidebar_header_text_active"); + return UM.Theme.getColor("topbar_button_text_active"); } else { - return UM.Theme.getColor("sidebar_header_text_inactive"); + return UM.Theme.getColor("topbar_button_text_inactive"); } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6d666b6413..85f62c2851 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -9,6 +9,10 @@ "bold": true, "family": "Open Sans" }, + "large_nonbold": { + "size": 1.25, + "family": "Open Sans" + }, "default": { "size": 1.15, "family": "Open Sans" @@ -59,6 +63,10 @@ "border": [127, 127, 127, 255], "secondary": [245, 245, 245, 255], + "topbar_button_text_active": [0, 0, 0, 255], + "topbar_button_text_inactive": [128, 128, 128, 255], + "topbar_button_text_hovered": [0, 0, 0, 255], + "text": [24, 41, 77, 255], "text_detail": [174, 174, 174, 128], "text_link": [12, 169, 227, 255], From 204e1ee834824070d2b26f12ed2efa2ea7ca9836 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 5 Sep 2017 11:41:30 +0200 Subject: [PATCH 26/45] PrintJobname is now only set when it was empty or if it's set to empty CURA-4276 fixes #2346 --- cura/PrintInformation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 47672a9823..6100b7a39e 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -227,7 +227,8 @@ class PrintInformation(QObject): # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its # extension. This cuts the extension off if necessary. name = os.path.splitext(name)[0] - if self._job_name != name: + + if self._job_name != name and (self._job_name == "" or name == ""): self._job_name = name self.jobNameChanged.emit() From 8472830fb9b901b302c5641eed7dfeaf8fcde193 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 5 Sep 2017 13:30:42 +0200 Subject: [PATCH 27/45] Fix adding machine prefix CURA-4276 --- cura/PrintInformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 6100b7a39e..d8c5129527 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -227,7 +227,7 @@ class PrintInformation(QObject): # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its # extension. This cuts the extension off if necessary. name = os.path.splitext(name)[0] - + name = self.createJobName(name) if self._job_name != name and (self._job_name == "" or name == ""): self._job_name = name self.jobNameChanged.emit() From 60c7d2f22e97fb5a8acb291da92291856b528535 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 5 Sep 2017 12:41:43 +0200 Subject: [PATCH 28/45] Update topbar CURA-4213 --- resources/qml/Topbar.qml | 46 +---- .../themes/cura-light/icons/tab_monitor.svg | 4 - .../cura-light/icons/tab_status_busy.svg | 10 +- .../cura-light/icons/tab_status_connected.svg | 8 +- .../cura-light/icons/tab_status_paused.svg | 9 +- .../cura-light/icons/tab_status_stopped.svg | 9 +- .../cura-light/icons/tab_status_unknown.svg | 9 +- resources/themes/cura-light/styles.qml | 183 ++++++++++++------ resources/themes/cura-light/theme.json | 2 +- .../themes/cura/icons/tab_status_busy.svg | 9 - .../cura/icons/tab_status_connected.svg | 7 - .../themes/cura/icons/tab_status_paused.svg | 8 - .../themes/cura/icons/tab_status_stopped.svg | 8 - .../themes/cura/icons/tab_status_unknown.svg | 8 - resources/themes/cura/images/logo.svg | 8 - 15 files changed, 141 insertions(+), 187 deletions(-) delete mode 100644 resources/themes/cura-light/icons/tab_monitor.svg delete mode 100644 resources/themes/cura/icons/tab_status_busy.svg delete mode 100644 resources/themes/cura/icons/tab_status_connected.svg delete mode 100644 resources/themes/cura/icons/tab_status_paused.svg delete mode 100644 resources/themes/cura/icons/tab_status_stopped.svg delete mode 100644 resources/themes/cura/icons/tab_status_unknown.svg delete mode 100644 resources/themes/cura/images/logo.svg diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index e29b9abf86..c5d46873cb 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -64,53 +64,21 @@ Rectangle checked: !base.monitoringPrint exclusiveGroup: sidebarHeaderBarGroup - style: UM.Theme.styles.topbar_header_tab + style: UM.Theme.styles.topbar_header_tab } Button { id: showMonitor + width: UM.Theme.getSize("topbar_button").width height: UM.Theme.getSize("sidebar_header").height onClicked: base.startMonitoringPrint() text: catalog.i18nc("@title:tab", "Monitor") - iconSource: UM.Theme.getIcon("tab_monitor") - property color overlayColor: - { - if(!printerAcceptsCommands) - { - return UM.Theme.getColor("status_unknown"); - } - - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") - { - return UM.Theme.getColor("status_busy"); - } - switch(Cura.MachineManager.printerOutputDevices[0].jobState) - { - case "printing": - case "pre_print": - case "wait_cleanup": - case "pausing": - case "resuming": - return UM.Theme.getColor("status_busy"); - case "ready": - case "": - return UM.Theme.getColor("status_ready"); - case "paused": - return UM.Theme.getColor("status_paused"); - case "error": - return UM.Theme.getColor("status_stopped"); - case "offline": - return UM.Theme.getColor("status_offline"); - default: - return UM.Theme.getColor("text_reversed"); - } - } - property string overlayIconSource: + property string iconSource: { if(!printerConnected) { - return ""; + return UM.Theme.getIcon("tab_status_unknown"); } else if(!printerAcceptsCommands) { @@ -138,7 +106,7 @@ Rectangle case "error": return UM.Theme.getIcon("tab_status_stopped") default: - return "" + return UM.Theme.getIcon("tab_status_unknown") } } @@ -146,7 +114,7 @@ Rectangle checked: base.monitoringPrint exclusiveGroup: sidebarHeaderBarGroup - style: UM.Theme.styles.topbar_header_tab + style: UM.Theme.styles.topbar_header_tab_no_overlay } ExclusiveGroup { id: sidebarHeaderBarGroup } @@ -215,7 +183,7 @@ Rectangle text: control.text; elide: Text.ElideRight; anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2 anchors.right: downArrow.left; anchors.rightMargin: control.rightMargin; anchors.verticalCenter: parent.verticalCenter; diff --git a/resources/themes/cura-light/icons/tab_monitor.svg b/resources/themes/cura-light/icons/tab_monitor.svg deleted file mode 100644 index afc661a22d..0000000000 --- a/resources/themes/cura-light/icons/tab_monitor.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_busy.svg b/resources/themes/cura-light/icons/tab_status_busy.svg index cf8e384d88..4df1a5b733 100644 --- a/resources/themes/cura-light/icons/tab_status_busy.svg +++ b/resources/themes/cura-light/icons/tab_status_busy.svg @@ -1,9 +1 @@ - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_connected.svg b/resources/themes/cura-light/icons/tab_status_connected.svg index 56aecdf0a7..4960e97d0f 100644 --- a/resources/themes/cura-light/icons/tab_status_connected.svg +++ b/resources/themes/cura-light/icons/tab_status_connected.svg @@ -1,7 +1 @@ - - - - - - - \ No newline at end of file +tab_status_connected \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_paused.svg b/resources/themes/cura-light/icons/tab_status_paused.svg index 0ec744ad86..7358d76305 100644 --- a/resources/themes/cura-light/icons/tab_status_paused.svg +++ b/resources/themes/cura-light/icons/tab_status_paused.svg @@ -1,8 +1 @@ - - - - - - - - \ No newline at end of file +tab_status_paused \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_stopped.svg b/resources/themes/cura-light/icons/tab_status_stopped.svg index ec1afaec81..d93f477ea7 100644 --- a/resources/themes/cura-light/icons/tab_status_stopped.svg +++ b/resources/themes/cura-light/icons/tab_status_stopped.svg @@ -1,8 +1 @@ - - - - - - - - \ No newline at end of file +tab_status_stopped \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_unknown.svg b/resources/themes/cura-light/icons/tab_status_unknown.svg index 382a2b2d8b..1ba37e06be 100644 --- a/resources/themes/cura-light/icons/tab_status_unknown.svg +++ b/resources/themes/cura-light/icons/tab_status_unknown.svg @@ -1,8 +1 @@ - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index d40fa1c9d1..cedb861da5 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -90,72 +90,44 @@ QtObject { } } - property Component topbar_header_tab: Component { + property Component topbar_header_tab_no_overlay: Component { ButtonStyle { - background: Item { - implicitWidth: Theme.getSize("topbar_button").width; - implicitHeight: Theme.getSize("topbar_button").height; + background: Rectangle { + implicitHeight: Theme.getSize("topbar_button").height + implicitWidth: Theme.getSize("topbar_button").width + color: "transparent" + anchors.fill: parent - Rectangle { - id: buttonFace; + Rectangle + { + id: underline - anchors.fill: parent; - property bool down: control.pressed || (control.checkable && control.checked); - - color: "transparent" - Behavior on color { ColorAnimation { duration: 50; } } - - Rectangle { - id: underline; - - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - width: Theme.getSize("topbar_button").width - height: Theme.getSize("sidebar_header_highlight").height - color: control.checked ? UM.Theme.getColor("sidebar_header_highlight") : UM.Theme.getColor("sidebar_header_highlight_hover") - visible: control.hovered || control.checked - } + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + width: parent.width + height: Theme.getSize("sidebar_header_highlight").height + color: control.checked ? UM.Theme.getColor("sidebar_header_highlight") : "transparent" + visible: control.hovered || control.checked } } - label: Item - { + label: Rectangle { implicitHeight: Theme.getSize("topbar_button_icon").height - implicitWidth: Theme.getSize("topbar_button").width; + implicitWidth: Theme.getSize("topbar_button").width + color: "transparent" + anchors.fill: parent + Item { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter; - width: childrenRect.width - height: Theme.getSize("topbar_button_icon").height - UM.RecolorImage - { - visible: control.iconSource != "" - id: icon - color: UM.Theme.getColor("text_emphasis") - opacity: !control.enabled ? 0.2 : 1.0 - source: control.iconSource - width: visible ? Theme.getSize("topbar_button_icon").width : 0 - height: Theme.getSize("topbar_button_icon").height - - sourceSize: Theme.getSize("topbar_button_icon") - } - UM.RecolorImage - { - visible: control.overlayIconSource != "" && control.iconSource != "" - color: control.overlayColor - opacity: !control.enabled ? 0.2 : 1.0 - source: control.overlayIconSource - width: visible ? Theme.getSize("topbar_button_icon").width : 0 - height: Theme.getSize("topbar_button_icon").height - - sourceSize: Theme.getSize("topbar_button_icon") - } + anchors.centerIn: parent + width: textLabel.width + icon.width + Theme.getSize("default_margin").width / 2 Label { - text: control.text; - anchors.left: icon.right - anchors.leftMargin: icon.visible ? Theme.getSize("default_margin").width : 0 + id: textLabel + text: control.text + anchors.right: icon.visible ? icon.left : parent.right + anchors.rightMargin: icon.visible ? Theme.getSize("default_margin").width / 2 : 0 anchors.verticalCenter: parent.verticalCenter; font: control.checked ? UM.Theme.getFont("large") : UM.Theme.getFont("large_nonbold") color: @@ -174,6 +146,107 @@ QtObject { } } } + Image + { + id: icon + visible: control.iconSource != "" + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + opacity: !control.enabled ? 0.2 : 1.0 + source: control.iconSource + width: visible ? Theme.getSize("topbar_button_icon").width : 0 + height: Theme.getSize("topbar_button_icon").height + + sourceSize: Theme.getSize("topbar_button_icon") + } + } + } + } + } + + property Component topbar_header_tab: Component { + ButtonStyle { + background: Item { + implicitHeight: Theme.getSize("topbar_button").height + implicitWidth: Theme.getSize("topbar_button").width + Theme.getSize("topbar_button_icon").width + + Rectangle { + id: buttonFace; + anchors.fill: parent; + + color: "transparent" + Behavior on color { ColorAnimation { duration: 50; } } + + Rectangle { + id: underline; + + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + width: Theme.getSize("topbar_button").width + Theme.getSize("topbar_button_icon").width + height: Theme.getSize("sidebar_header_highlight").height + color: control.checked ? UM.Theme.getColor("sidebar_header_highlight") : UM.Theme.getColor("sidebar_header_highlight_hover") + visible: control.hovered || control.checked + } + } + } + + label: Item + { + implicitHeight: Theme.getSize("topbar_button_icon").height + implicitWidth: Theme.getSize("topbar_button").width + Theme.getSize("topbar_button_icon").width + Item + { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter; + width: childrenRect.width + height: Theme.getSize("topbar_button_icon").height + Label + { + text: control.text; + anchors.right: (icon.visible || overlayIcon.visible) ? icon.left : parent.right + anchors.rightMargin: (icon.visible || overlayIcon.visible) ? Theme.getSize("default_margin").width : 0 + anchors.verticalCenter: parent.verticalCenter; + font: control.checked ? UM.Theme.getFont("large") : UM.Theme.getFont("large_nonbold") + color: + { + if(control.hovered) + { + return UM.Theme.getColor("topbar_button_text_hovered"); + } + if(control.checked) + { + return UM.Theme.getColor("topbar_button_text_active"); + } + else + { + return UM.Theme.getColor("topbar_button_text_inactive"); + } + } + } + UM.RecolorImage + { + visible: control.iconSource != "" + id: icon + color: UM.Theme.getColor("text_emphasis") + opacity: !control.enabled ? 0.2 : 1.0 + source: control.iconSource + width: visible ? Theme.getSize("topbar_button_icon").width : 0 + height: Theme.getSize("topbar_button_icon").height + + sourceSize: Theme.getSize("topbar_button_icon") + } + UM.RecolorImage + { + id: overlayIcon + visible: control.overlayIconSource != "" && control.iconSource != "" + color: control.overlayColor + opacity: !control.enabled ? 0.2 : 1.0 + source: control.overlayIconSource + width: visible ? Theme.getSize("topbar_button_icon").width : 0 + height: Theme.getSize("topbar_button_icon").height + + sourceSize: Theme.getSize("topbar_button_icon") + } } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 398fbac3eb..0eb66c9e76 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -310,7 +310,7 @@ "topbar_logo_right_margin": [3, 0], "topbar_button": [8, 4], - "topbar_button_icon": [3.125, 2.5], + "topbar_button_icon": [1.2, 1.2], "button_tooltip": [1.0, 1.3], "button_tooltip_arrow": [0.25, 0.25], diff --git a/resources/themes/cura/icons/tab_status_busy.svg b/resources/themes/cura/icons/tab_status_busy.svg deleted file mode 100644 index 7b5774e71b..0000000000 --- a/resources/themes/cura/icons/tab_status_busy.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/resources/themes/cura/icons/tab_status_connected.svg b/resources/themes/cura/icons/tab_status_connected.svg deleted file mode 100644 index 7997ffbee6..0000000000 --- a/resources/themes/cura/icons/tab_status_connected.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/resources/themes/cura/icons/tab_status_paused.svg b/resources/themes/cura/icons/tab_status_paused.svg deleted file mode 100644 index 606d4cb96c..0000000000 --- a/resources/themes/cura/icons/tab_status_paused.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources/themes/cura/icons/tab_status_stopped.svg b/resources/themes/cura/icons/tab_status_stopped.svg deleted file mode 100644 index 6cd0f18b17..0000000000 --- a/resources/themes/cura/icons/tab_status_stopped.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources/themes/cura/icons/tab_status_unknown.svg b/resources/themes/cura/icons/tab_status_unknown.svg deleted file mode 100644 index 5e46eec55b..0000000000 --- a/resources/themes/cura/icons/tab_status_unknown.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources/themes/cura/images/logo.svg b/resources/themes/cura/images/logo.svg deleted file mode 100644 index 545b42d193..0000000000 --- a/resources/themes/cura/images/logo.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 81b667551826b14eb8ca6be2742732ed66c65a01 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 6 Sep 2017 11:15:40 +0200 Subject: [PATCH 29/45] Improved logging for network output --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index ec1b0ac175..450f92a6e3 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -1099,8 +1099,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): global_container_stack.setMetaDataEntry("network_authentication_id", self._authentication_id) else: global_container_stack.addMetaDataEntry("network_authentication_id", self._authentication_id) - Application.getInstance().saveStack(global_container_stack) # Force save so we are sure the data is not lost. - Logger.log("i", "Authentication succeeded for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + Logger.log("i", "Authentication succeeded for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + Application.getInstance().saveStack(global_container_stack) # Force save so we are sure the data is not lost. + else: + Logger.log("w", "Unable to save authentication for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + else: # Got a response that we didn't expect, so something went wrong. Logger.log("e", "While trying to authenticate, we got an unexpected response: %s", reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)) self.setAuthenticationState(AuthState.NotAuthenticated) From e15a96263d63d58e51a153b2b266d88d624b3f02 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 10:20:38 +0200 Subject: [PATCH 30/45] Update extruder button styles CURA-4211 --- cura/CuraApplication.py | 6 + .../UM3NetworkPrinting/DiscoverUM3Action.py | 1 + resources/qml/ExtruderButton.qml | 11 +- resources/qml/SidebarHeader.qml | 127 ++++++++++++++---- resources/qml/Topbar.qml | 3 +- .../cura-light/icons/extruder_button.svg | 8 +- resources/themes/cura-light/theme.json | 9 +- 7 files changed, 121 insertions(+), 44 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index ee1c1aeec6..0b8705799f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -125,6 +125,8 @@ class CuraApplication(QtApplication): # Cura will always show the Add Machine Dialog upon start. stacksValidationFinished = pyqtSignal() # Emitted whenever a validation is finished + syncConfigurationFromPrinter = pyqtSignal() # Emitted when the user wants to sync configuration from printer + def __init__(self): # this list of dir names will be used by UM to detect an old cura directory for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "user", "variants"]: @@ -1393,3 +1395,7 @@ class CuraApplication(QtApplication): node = node.getParent() Selection.add(node) + + @pyqtSlot() + def startSyncingConfigurationFromPrinter(self): + self.syncConfigurationFromPrinter.emit() diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.py b/plugins/UM3NetworkPrinting/DiscoverUM3Action.py index af1a556892..ff222b6aeb 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.py +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.py @@ -26,6 +26,7 @@ class DiscoverUM3Action(MachineAction): self.__additional_components_view = None Application.getInstance().engineCreatedSignal.connect(self._createAdditionalComponentsView) + Application.getInstance().syncConfigurationFromPrinter.connect(self.loadConfigurationFromPrinter) self._last_zeroconf_event_time = time.time() self._zeroconf_change_grace_period = 0.25 # Time to wait after a zeroconf service change before allowing a zeroconf reset diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index 0037207e87..039158280a 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -57,17 +57,18 @@ Button { right: parent.right top: parent.top - margins: UM.Theme.getSize("extruder_button_material_margin").width + rightMargin: UM.Theme.getSize("extruder_button_material_margin").width + topMargin: UM.Theme.getSize("extruder_button_material_margin").height } color: model.color - width: UM.Theme.getSize("extruder_button_material_size").width - height: UM.Theme.getSize("extruder_button_material_size").height + width: UM.Theme.getSize("extruder_button_material").width + height: UM.Theme.getSize("extruder_button_material").height radius: width / 2 - border.width: 0 - border.color: "transparent" + border.width: 1 + border.color: UM.Theme.getColor("extruder_button_material_border") opacity: !base.enabled ? 0.2 : 1.0 } diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index f3ed19d521..0e78cc336d 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -24,41 +24,109 @@ Column Item { - height: UM.Theme.getSize("default_margin").height / 4 - width: height - visible: extruderSelectionRow.visible - } - - Label - { - id: extruderSelectionLabel anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width + leftMargin: UM.Theme.getSize("sidebar_margin").width right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width + rightMargin: UM.Theme.getSize("sidebar_margin").width + topMargin: UM.Theme.getSize("default_margin").height } - height: UM.Theme.getSize("sidebar_tabs").height / 3 - text: catalog.i18nc("@label", "Extruder configuration") - font: UM.Theme.getFont("default_bold") - color: UM.Theme.getColor("text") visible: extruderSelectionRow.visible + height: syncMachineButton.height + UM.Theme.getSize("sidebar_margin").height / 2 + + Label + { + id: extruderSelectionLabel + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + + height: UM.Theme.getSize("sidebar_tabs").height / 3 + text: catalog.i18nc("@label", "Extruder configuration") + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + visible: extruderSelectionRow.visible + } + + Button + { + id: syncMachineButton + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + text: catalog.i18nc("@button:action", "Sync") + visible: extruderSelectionRow.visible + + property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 + enabled: printerConnected + + onClicked: + { + CuraApplication.startSyncingConfigurationFromPrinter(); + } + + style: ButtonStyle + { + background: Rectangle + { + implicitWidth: UM.Theme.getSize("button").width * 1.1 + implicitHeight: UM.Theme.getSize("sidebar_tabs").height / 3 + color: "transparent" + } + label: Item + { + implicitWidth: UM.Theme.getSize("button").width * 1.1 + implicitHeight: UM.Theme.getSize("sidebar_tabs").height / 3 + Label + { + id: labelText + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2 + anchors.top: parent.top + + text: control.text + font: UM.Theme.getFont("default") + color: control.hovered ? UM.Theme.getColor("sync_button_text_hovered") : UM.Theme.getColor("sync_button_text") + + elide: Text.ElideRight; + verticalAlignment: Text.AlignVCenter; + } + + UM.RecolorImage + { + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.top: labelText.top + anchors.topMargin: UM.Theme.getSize("default_margin").height / 3 + + source: UM.Theme.getIcon("arrow_bottom") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 + sourceSize.height: width + 5 + + color: control.hovered ? UM.Theme.getColor("sync_button_text_hovered") : UM.Theme.getColor("sync_button_text") + } + } + } + } } Item { id: extruderSelectionRow width: parent.width - height: UM.Theme.getSize("sidebar_tabs").height + height: UM.Theme.getSize("sidebar_tabs").height * 2 / 3 visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width + leftMargin: UM.Theme.getSize("default_margin").width * 1.5 right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width + rightMargin: UM.Theme.getSize("default_margin").width * 1.5 } ListView @@ -136,7 +204,7 @@ Column width: { var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0; var iconWidth = extruderIconItem.width; - return extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 4; + return extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 2; } // Static text "Extruder" @@ -150,7 +218,7 @@ Column control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text") - font: UM.Theme.getFont("default") + font: control.checked ? UM.Theme.getFont("default_bold") : UM.Theme.getFont("default") text: catalog.i18nc("@label", "Extruder") visible: width < (control.width - extruderIconItem.width - UM.Theme.getSize("default_margin").width) elide: Text.ElideRight @@ -168,7 +236,7 @@ Column var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width; var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height; var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight; - minimumSize -= UM.Theme.getSize("default_margin").width; + minimumSize -= UM.Theme.getSize("default_margin").width / 2; return minimumSize; } @@ -205,18 +273,18 @@ Column { right: parent.right top: parent.top - rightMargin: parent.sizeToUse * 0.04 - topMargin: parent.sizeToUse * 0.04 + rightMargin: parent.sizeToUse * 0.01 + topMargin: parent.sizeToUse * 0.05 } color: model.color - width: parent.width * 0.27 - height: parent.height * 0.27 + width: parent.width * 0.35 + height: parent.height * 0.35 radius: width / 2 - border.width: 0 - border.color: "transparent" + border.width: 1 + border.color: UM.Theme.getColor("extruder_button_material_border") opacity: !control.checked ? 0.6 : 1.0 } @@ -337,7 +405,7 @@ Column Item { id: materialInfoRow - height: UM.Theme.getSize("sidebar_setup").height + height: UM.Theme.getSize("sidebar_setup").height / 2 visible: (Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials) && !sidebar.monitoringPrint && !sidebar.hideSettings anchors @@ -358,10 +426,11 @@ Column { id: materialInfoLabel wrapMode: Text.WordWrap - text: catalog.i18nc("@label", "Check material compability"); + text: catalog.i18nc("@label", "Check material compability") font: UM.Theme.getFont("default"); - verticalAlignment: Text.AlignVCenter + verticalAlignment: Text.AlignTop anchors.top: parent.top + anchors.right: parent.right anchors.bottom: parent.bottom color: UM.Theme.getColor("text") diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 3e612b1478..9342e4d781 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -111,10 +111,11 @@ Rectangle { case "printing": case "pre_print": - case "wait_cleanup": case "pausing": case "resuming": return UM.Theme.getIcon("tab_status_busy"); + case "wait_cleanup": + return UM.Theme.getIcon("tab_status_finished"); case "ready": case "": return UM.Theme.getIcon("tab_status_connected") diff --git a/resources/themes/cura-light/icons/extruder_button.svg b/resources/themes/cura-light/icons/extruder_button.svg index 883e3caaf4..e3c01b6a0a 100644 --- a/resources/themes/cura-light/icons/extruder_button.svg +++ b/resources/themes/cura-light/icons/extruder_button.svg @@ -41,7 +41,7 @@ showgrid="false" inkscape:pagecheckerboard="true" inkscape:zoom="23.442308" - inkscape:cx="11.848284" + inkscape:cx="4.9163727" inkscape:cy="17.941232" inkscape:window-x="2552" inkscape:window-y="-8" @@ -61,10 +61,4 @@ style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" rx="13.735848" ry="13.735849" /> - diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 3364ff8932..8025ed61be 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -96,6 +96,11 @@ "button_tooltip_border": [24, 41, 77, 255], "button_tooltip_text": [24, 41, 77, 255], + "extruder_button_material_border": [255, 255, 255, 255], + + "sync_button_text": [120, 120, 120, 255], + "sync_button_text_hovered": [0, 0, 0, 255], + "tab_checked": [255, 255, 255, 255], "tab_checked_border": [255, 255, 255, 255], "tab_checked_text": [24, 41, 77, 255], @@ -261,8 +266,8 @@ "default_arrow": [0.8, 0.8], "logo": [9.5, 2.0], - "extruder_button_material_margin": [0.875, 0.875], - "extruder_button_material_size": [0.68, 0.68], + "extruder_button_material_margin": [0.50, 0.9], + "extruder_button_material": [0.75, 0.75], "sidebar": [35.0, 10.0], "sidebar_margin": [1.71, 1.43], From fc7207e77e47f906626c7a5de8334df6936ea924 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 12:17:40 +0200 Subject: [PATCH 31/45] Remove "Sync" button CURA-4211 --- cura/CuraApplication.py | 6 -- .../UM3NetworkPrinting/DiscoverUM3Action.py | 1 - resources/qml/SidebarHeader.qml | 65 ------------------- 3 files changed, 72 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 0b8705799f..ee1c1aeec6 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -125,8 +125,6 @@ class CuraApplication(QtApplication): # Cura will always show the Add Machine Dialog upon start. stacksValidationFinished = pyqtSignal() # Emitted whenever a validation is finished - syncConfigurationFromPrinter = pyqtSignal() # Emitted when the user wants to sync configuration from printer - def __init__(self): # this list of dir names will be used by UM to detect an old cura directory for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "user", "variants"]: @@ -1395,7 +1393,3 @@ class CuraApplication(QtApplication): node = node.getParent() Selection.add(node) - - @pyqtSlot() - def startSyncingConfigurationFromPrinter(self): - self.syncConfigurationFromPrinter.emit() diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.py b/plugins/UM3NetworkPrinting/DiscoverUM3Action.py index ff222b6aeb..af1a556892 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.py +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.py @@ -26,7 +26,6 @@ class DiscoverUM3Action(MachineAction): self.__additional_components_view = None Application.getInstance().engineCreatedSignal.connect(self._createAdditionalComponentsView) - Application.getInstance().syncConfigurationFromPrinter.connect(self.loadConfigurationFromPrinter) self._last_zeroconf_event_time = time.time() self._zeroconf_change_grace_period = 0.25 # Time to wait after a zeroconf service change before allowing a zeroconf reset diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 0e78cc336d..a12274ca35 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -47,71 +47,6 @@ Column color: UM.Theme.getColor("text") visible: extruderSelectionRow.visible } - - Button - { - id: syncMachineButton - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - text: catalog.i18nc("@button:action", "Sync") - visible: extruderSelectionRow.visible - - property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 - enabled: printerConnected - - onClicked: - { - CuraApplication.startSyncingConfigurationFromPrinter(); - } - - style: ButtonStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("button").width * 1.1 - implicitHeight: UM.Theme.getSize("sidebar_tabs").height / 3 - color: "transparent" - } - label: Item - { - implicitWidth: UM.Theme.getSize("button").width * 1.1 - implicitHeight: UM.Theme.getSize("sidebar_tabs").height / 3 - Label - { - id: labelText - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2 - anchors.top: parent.top - - text: control.text - font: UM.Theme.getFont("default") - color: control.hovered ? UM.Theme.getColor("sync_button_text_hovered") : UM.Theme.getColor("sync_button_text") - - elide: Text.ElideRight; - verticalAlignment: Text.AlignVCenter; - } - - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.top: labelText.top - anchors.topMargin: UM.Theme.getSize("default_margin").height / 3 - - source: UM.Theme.getIcon("arrow_bottom") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 - sourceSize.height: width + 5 - - color: control.hovered ? UM.Theme.getColor("sync_button_text_hovered") : UM.Theme.getColor("sync_button_text") - } - } - } - } } Item From e163cc0d8483b3335b1936cc64a6ba2a3ea53298 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 12:43:42 +0200 Subject: [PATCH 32/45] Remove "Extruder Configuration" text CURA-4211 --- resources/qml/SidebarHeader.qml | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index a12274ca35..54605dd860 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -17,11 +17,23 @@ Column property int currentExtruderIndex: ExtruderManager.activeExtruderIndex; property bool currentExtruderVisible: extrudersList.visible; - spacing: UM.Theme.getSize("sidebar_margin").height + spacing: UM.Theme.getSize("sidebar_margin").height / 2 signal showTooltip(Item item, point location, string text) signal hideTooltip() + Item + { + anchors + { + left: parent.left + right: parent.right + } + visible: extruderSelectionRow.visible + height: UM.Theme.getSize("default_lining").height + width: height + } + Item { anchors @@ -30,23 +42,10 @@ Column leftMargin: UM.Theme.getSize("sidebar_margin").width right: parent.right rightMargin: UM.Theme.getSize("sidebar_margin").width - topMargin: UM.Theme.getSize("default_margin").height } visible: extruderSelectionRow.visible - height: syncMachineButton.height + UM.Theme.getSize("sidebar_margin").height / 2 - - Label - { - id: extruderSelectionLabel - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - - height: UM.Theme.getSize("sidebar_tabs").height / 3 - text: catalog.i18nc("@label", "Extruder configuration") - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") - visible: extruderSelectionRow.visible - } + height: UM.Theme.getSize("default_lining").hieght + width: height } Item @@ -59,9 +58,10 @@ Column anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width * 1.5 + leftMargin: UM.Theme.getSize("default_margin").width * 1.4 right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width * 1.5 + rightMargin: UM.Theme.getSize("default_margin").width * 1.4 + topMargin: UM.Theme.getSize("default_margin").height } ListView From 34f8db5450c58a825de311ea657849add6e29dcf Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 6 Sep 2017 14:52:16 +0200 Subject: [PATCH 33/45] Changed some margins to improve alignment CURA-4211 --- resources/qml/Sidebar.qml | 6 +++--- resources/qml/SidebarHeader.qml | 8 ++++---- resources/qml/SidebarSimple.qml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index be0b12af19..bdffee4ff3 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -121,7 +121,7 @@ Rectangle anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.top: headerSeparator.bottom anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - width: parent.width * 0.45 - 2 * UM.Theme.getSize("sidebar_margin").width + width: parent.width * 0.45 font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") visible: !monitoringPrint @@ -223,7 +223,7 @@ Rectangle { id: globalProfileLabel text: catalog.i18nc("@label","Profile:"); - width: parent.width * 0.45 - UM.Theme.getSize("sidebar_margin").width + width: parent.width * 0.45 - UM.Theme.getSize("sidebar_margin").width - 2 font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); verticalAlignment: Text.AlignVCenter @@ -247,7 +247,7 @@ Rectangle } enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1 - width: parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width + width: parent.width * 0.55 height: UM.Theme.getSize("setting_control").height anchors.left: globalProfileLabel.right anchors.right: parent.right diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 54605dd860..391b6c131a 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -17,7 +17,7 @@ Column property int currentExtruderIndex: ExtruderManager.activeExtruderIndex; property bool currentExtruderVisible: extrudersList.visible; - spacing: UM.Theme.getSize("sidebar_margin").height / 2 + spacing: UM.Theme.getSize("sidebar_margin").width * 0.9 signal showTooltip(Item item, point location, string text) signal hideTooltip() @@ -58,10 +58,10 @@ Column anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width * 1.4 + leftMargin: UM.Theme.getSize("sidebar_margin").width * 0.7 right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width * 1.4 - topMargin: UM.Theme.getSize("default_margin").height + rightMargin: UM.Theme.getSize("sidebar_margin").width * 0.7 + topMargin: UM.Theme.getSize("sidebar_margin").height } ListView diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 8d83dd1468..c2882f8e0e 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -40,7 +40,7 @@ Item id: infillCellLeft anchors.top: parent.top anchors.left: parent.left - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 0.8 width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width height: childrenRect.height @@ -275,7 +275,7 @@ Item property alias _hovered: enableSupportMouseArea.containsMouse anchors.top: infillCellRight.bottom - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 2 + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.left: infillCellRight.left style: UM.Theme.styles.checkbox; From e18528d2ca596ce74ed3d722c681193155f4e259 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 15:49:54 +0200 Subject: [PATCH 34/45] Fix position of the material compatibility warning CURA-4148 --- resources/qml/SidebarHeader.qml | 31 +++++++++++++------------- resources/themes/cura-light/theme.json | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 391b6c131a..3c26638b0a 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -357,6 +357,22 @@ Column anchors.right: parent.right width: parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width + UM.RecolorImage + { + id: warningImage + anchors.right: materialInfoLabel.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: parent.Bottom + source: UM.Theme.getIcon("warning") + width: UM.Theme.getSize("section_icon").width + height: UM.Theme.getSize("section_icon").height + //sourceSize.width: width + 5 + //sourceSize.height: width + 5 + + color: UM.Theme.getColor("setting_validation_warning") + visible: !Cura.MachineManager.isCurrentSetupSupported + } + Text { id: materialInfoLabel @@ -395,21 +411,6 @@ Column onExited: base.hideTooltip(); } } - - UM.RecolorImage - { - id: warningImage - anchors.right: parent.right - anchors.verticalCenter: parent.Bottom - source: UM.Theme.getIcon("warning") - width: UM.Theme.getSize("section_icon").width - height: UM.Theme.getSize("section_icon").height - //sourceSize.width: width + 5 - //sourceSize.height: width + 5 - - color: UM.Theme.getColor("setting_validation_warning") - visible: !Cura.MachineManager.isCurrentSetupSupported - } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 46d5ff0662..d4d12c24cd 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -173,7 +173,7 @@ "setting_validation_error_background": [255, 57, 14, 255], "setting_validation_error": [127, 127, 127, 255], "setting_validation_warning_background": [255, 186, 15, 255], - "setting_validation_warning": [127, 127, 127, 255], + "setting_validation_warning": [0, 0, 0, 255], "setting_validation_ok": [255, 255, 255, 255], "progressbar_background": [245, 245, 245, 255], From 1dd5f7b0ee87081bb5107d87b21c2389e2119e93 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 12:55:05 +0200 Subject: [PATCH 35/45] Update machine state icons CURA-4148 --- .../themes/cura-light/icons/tab_status_busy.svg | 14 +++++++++++++- .../cura-light/icons/tab_status_connected.svg | 14 +++++++++++++- .../cura-light/icons/tab_status_finished.svg | 13 +++++++++++++ .../themes/cura-light/icons/tab_status_paused.svg | 14 +++++++++++++- .../themes/cura-light/icons/tab_status_stopped.svg | 14 +++++++++++++- 5 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 resources/themes/cura-light/icons/tab_status_finished.svg diff --git a/resources/themes/cura-light/icons/tab_status_busy.svg b/resources/themes/cura-light/icons/tab_status_busy.svg index 4df1a5b733..debe4f6360 100644 --- a/resources/themes/cura-light/icons/tab_status_busy.svg +++ b/resources/themes/cura-light/icons/tab_status_busy.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + Busy + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_connected.svg b/resources/themes/cura-light/icons/tab_status_connected.svg index 4960e97d0f..a8ff015a9d 100644 --- a/resources/themes/cura-light/icons/tab_status_connected.svg +++ b/resources/themes/cura-light/icons/tab_status_connected.svg @@ -1 +1,13 @@ -tab_status_connected \ No newline at end of file + + + + Connected + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_finished.svg b/resources/themes/cura-light/icons/tab_status_finished.svg new file mode 100644 index 0000000000..2519f2f862 --- /dev/null +++ b/resources/themes/cura-light/icons/tab_status_finished.svg @@ -0,0 +1,13 @@ + + + + Wait cleanup + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_paused.svg b/resources/themes/cura-light/icons/tab_status_paused.svg index 7358d76305..bab6c9ca6b 100644 --- a/resources/themes/cura-light/icons/tab_status_paused.svg +++ b/resources/themes/cura-light/icons/tab_status_paused.svg @@ -1 +1,13 @@ -tab_status_paused \ No newline at end of file + + + + paused + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/tab_status_stopped.svg b/resources/themes/cura-light/icons/tab_status_stopped.svg index d93f477ea7..c9b150db3a 100644 --- a/resources/themes/cura-light/icons/tab_status_stopped.svg +++ b/resources/themes/cura-light/icons/tab_status_stopped.svg @@ -1 +1,13 @@ -tab_status_stopped \ No newline at end of file + + + + Aborted + Created with Sketch. + + + + + + + + \ No newline at end of file From 24e5c72e4713633375af1d992cb0ddcfad074e22 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 13:07:20 +0200 Subject: [PATCH 36/45] Update colour for light theme CURA-4148 --- resources/qml/Sidebar.qml | 2 +- resources/qml/SidebarHeader.qml | 5 +-- resources/themes/cura-light/styles.qml | 2 + resources/themes/cura-light/theme.json | 62 ++++++++++++++------------ 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index bdffee4ff3..ce13a5eddf 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -181,7 +181,7 @@ Rectangle color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") : control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text") - font: UM.Theme.getFont("default") + font: (control.checked || control.pressed) ? UM.Theme.getFont("default_bold") : UM.Theme.getFont("default") text: control.text; } } diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 3c26638b0a..f2fc0c0027 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -123,8 +123,7 @@ Column { anchors.fill: parent border.width: UM.Theme.getSize("default_lining").width - border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : - control.hovered ? UM.Theme.getColor("action_button_hovered_border") : + border.color: control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border") color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : @@ -369,7 +368,7 @@ Column //sourceSize.width: width + 5 //sourceSize.height: width + 5 - color: UM.Theme.getColor("setting_validation_warning") + color: UM.Theme.getColor("material_compatibility_warning") visible: !Cura.MachineManager.isCurrentSetupSupported } diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index cedb861da5..bb2b57509a 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -309,6 +309,8 @@ QtObject { } Behavior on color { ColorAnimation { duration: 50; } } + border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? 2 : 0 + border.color: Theme.getColor("tool_button_border") UM.RecolorImage { id: tool_button_arrow diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index d4d12c24cd..530dbbd487 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -54,7 +54,7 @@ "colors": { "sidebar": [255, 255, 255, 255], - "lining": [127, 127, 127, 255], + "lining": [192, 193, 194, 255], "viewport_overlay": [24, 41, 77, 192], "primary": [12, 169, 227, 255], @@ -67,32 +67,32 @@ "topbar_button_text_inactive": [128, 128, 128, 255], "topbar_button_text_hovered": [0, 0, 0, 255], - "text": [24, 41, 77, 255], + "text": [0, 0, 0, 255], "text_detail": [174, 174, 174, 128], "text_link": [12, 169, 227, 255], "text_inactive": [174, 174, 174, 255], "text_hover": [70, 84, 113, 255], "text_pressed": [12, 169, 227, 255], - "text_subtext": [70, 84, 113, 255], + "text_subtext": [0, 0, 0, 255], "text_emphasis": [255, 255, 255, 255], "text_scene": [24, 41, 77, 255], "text_scene_hover": [70, 84, 113, 255], "error": [255, 140, 0, 255], - "sidebar_header_bar": [24, 41, 77, 255], - "sidebar_header_active": [70, 84, 113, 255], - "sidebar_header_hover": [24, 41, 77, 255], - "sidebar_header_highlight": [12, 169, 227, 255], - "sidebar_header_highlight_hover": [255, 255, 255, 255], + "sidebar_header_bar": [31, 36, 39, 255], + "sidebar_header_active": [68, 72, 75, 255], + "sidebar_header_hover": [68, 72, 75, 255], + "sidebar_header_highlight": [68, 192, 255, 255], + "sidebar_header_highlight_hover": [68, 192, 255, 255], "sidebar_header_text_inactive": [255, 255, 255, 255], "sidebar_header_text_active": [255, 255, 255, 255], "sidebar_header_text_hover": [255, 255, 255, 255], "sidebar_lining": [245, 245, 245, 255], - "button": [24, 41, 77, 255], - "button_hover": [70, 84, 113, 255], - "button_active": [32, 166, 219, 255], - "button_active_hover": [12, 169, 227, 255], + "button": [31, 36, 39, 255], + "button_hover": [68, 72, 75, 255], + "button_active": [68, 72, 75, 255], + "button_active_hover": [68, 72, 75, 255], "button_text": [255, 255, 255, 255], "button_text_hover": [255, 255, 255, 255], "button_text_active": [255, 255, 255, 255], @@ -100,9 +100,9 @@ "button_disabled": [24, 41, 77, 255], "button_disabled_text": [255, 255, 255, 101], - "button_tooltip": [12, 169, 227, 255], - "button_tooltip_border": [24, 41, 77, 255], - "button_tooltip_text": [24, 41, 77, 255], + "button_tooltip": [31, 36, 39, 255], + "button_tooltip_border": [68, 192, 255, 255], + "button_tooltip_text": [192, 193, 194, 255], "extruder_button_material_border": [255, 255, 255, 255], @@ -123,14 +123,14 @@ "tab_active_text": [24, 41, 77, 255], "tab_background": [245, 245, 245, 255], - "action_button": [255, 255, 255, 255], - "action_button_text": [24, 41, 77, 255], + "action_button": [242, 242, 242, 255], + "action_button_text": [0, 0, 0, 255], "action_button_border": [127, 127, 127, 255], "action_button_hovered": [255, 255, 255, 255], "action_button_hovered_text": [24, 41, 77, 255], "action_button_hovered_border": [12, 169, 227, 255], - "action_button_active": [12, 169, 227, 255], - "action_button_active_text": [255, 255, 255, 255], + "action_button_active": [255, 255, 255, 255], + "action_button_active_text": [0, 0, 0, 255], "action_button_active_border": [12, 169, 227, 255], "action_button_disabled": [245, 245, 245, 255], "action_button_disabled_text": [127, 127, 127, 255], @@ -170,12 +170,14 @@ "setting_control_disabled_text": [127, 127, 127, 255], "setting_control_disabled_border": [127, 127, 127, 255], "setting_unit": [127, 127, 127, 255], - "setting_validation_error_background": [255, 57, 14, 255], + "setting_validation_error_background": [255, 66, 60, 255], "setting_validation_error": [127, 127, 127, 255], - "setting_validation_warning_background": [255, 186, 15, 255], - "setting_validation_warning": [0, 0, 0, 255], + "setting_validation_warning_background": [255, 145, 62, 255], + "setting_validation_warning": [127, 127, 127, 255], "setting_validation_ok": [255, 255, 255, 255], + "material_compatibility_warning": [0, 0, 0, 255], + "progressbar_background": [245, 245, 245, 255], "progressbar_control": [24, 41, 77, 255], @@ -186,12 +188,12 @@ "slider_handle_hover": [77, 182, 226, 255], "slider_text_background": [255, 255, 255, 255], - "checkbox": [255, 255, 255, 255], - "checkbox_hover": [255, 255, 255, 255], - "checkbox_border": [127, 127, 127, 255], + "checkbox": [39, 44, 48, 255], + "checkbox_hover": [68, 72, 75, 255], + "checkbox_border": [64, 69, 72, 255], "checkbox_border_hover": [12, 169, 227, 255], - "checkbox_mark": [24, 41, 77, 255], - "checkbox_text": [24, 41, 77, 255], + "checkbox_mark": [119, 122, 124, 255], + "checkbox_text": [166, 168, 169, 255], "mode_switch": [255, 255, 255, 255], "mode_switch_hover": [255, 255, 255, 255], @@ -202,9 +204,11 @@ "mode_switch_text_hover": [24, 41, 77, 255], "mode_switch_text_checked": [12, 169, 227, 255], - "tooltip": [12, 169, 227, 255], + "tooltip": [68, 192, 255, 255], "tooltip_text": [255, 255, 255, 255], + "tool_button_border": [39, 44, 48, 255], + "message_background": [24, 41, 77, 255], "message_text": [255, 255, 255, 255], "message_border": [24, 41, 77, 255], @@ -217,7 +221,7 @@ "message_progressbar_background": [255, 255, 255, 255], "message_progressbar_control": [12, 169, 227, 255], - "tool_panel_background": [255, 255, 255, 255], + "tool_panel_background": [31, 36, 39, 255], "status_offline": [0, 0, 0, 255], "status_ready": [0, 205, 0, 255], From 8010fa9c85a1460c6e4b20c422df8a453b0e1e09 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 16:09:25 +0200 Subject: [PATCH 37/45] White background for checkboxes CURA-4148 --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 530dbbd487..c68ac91569 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -188,7 +188,7 @@ "slider_handle_hover": [77, 182, 226, 255], "slider_text_background": [255, 255, 255, 255], - "checkbox": [39, 44, 48, 255], + "checkbox": [255, 255, 255, 255], "checkbox_hover": [68, 72, 75, 255], "checkbox_border": [64, 69, 72, 255], "checkbox_border_hover": [12, 169, 227, 255], From 40b60a2d950684c3a377b7baf2228a019c61b122 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 16:23:27 +0200 Subject: [PATCH 38/45] Fix colour for LayView panel and per object settings panel CURA-4148 --- plugins/LayerView/LayerView.qml | 10 +++++----- resources/themes/cura-light/theme.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index 53f44f3f03..ff8bfcb988 100755 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -72,7 +72,7 @@ Item anchors.left: parent.left text: catalog.i18nc("@label","View Mode: Layers") font: UM.Theme.getFont("default_bold"); - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("setting_control_text") Layout.fillWidth: true elide: Text.ElideMiddle; } @@ -93,7 +93,7 @@ Item font: UM.Theme.getFont("default"); visible: !UM.LayerView.compatibilityMode Layout.fillWidth: true - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("setting_control_text") } ListModel // matches LayerView.py @@ -211,7 +211,7 @@ Item { text: model.name elide: Text.ElideRight - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("button_text") font: UM.Theme.getFont("default") anchors.verticalCenter: parent.verticalCenter anchors.left: extrudersModelCheckBox.left; @@ -280,7 +280,7 @@ Item text: label font: UM.Theme.getFont("default") elide: Text.ElideRight - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("button_text") anchors.verticalCenter: parent.verticalCenter anchors.left: legendModelCheckBox.left; anchors.right: legendModelCheckBox.right; @@ -343,7 +343,7 @@ Item Layout.fillWidth: true Layout.preferredHeight: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height Layout.preferredWidth: UM.Theme.getSize("layerview_row").width - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("button_text") font: UM.Theme.getFont("default") } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index c68ac91569..783d0c9edc 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -162,7 +162,7 @@ "setting_control_highlight": [255, 255, 255, 0], "setting_control_border": [127, 127, 127, 255], "setting_control_border_highlight": [12, 169, 227, 255], - "setting_control_text": [24, 41, 77, 255], + "setting_control_text": [127, 127, 127, 255], "setting_control_depth_line": [127, 127, 127, 255], "setting_control_button": [127, 127, 127, 255], "setting_control_button_hover": [70, 84, 113, 255], From b239eb9eaf597ca15f548272f4f6eefbd6d6455b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 16:35:56 +0200 Subject: [PATCH 39/45] No extruder numbers for per-object settings CURA-4284 --- resources/definitions/fdmprinter.def.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 5a7cca5a31..817da65247 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -869,7 +869,7 @@ "description": "The extruder train used for printing the outer wall. This is used in multi-extrusion.", "type": "optional_extruder", "default_value": "-1", - "settable_per_mesh": true, + "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": true, "settable_globally": true, @@ -881,7 +881,7 @@ "description": "The extruder train used for printing the inner walls. This is used in multi-extrusion.", "type": "optional_extruder", "default_value": "-1", - "settable_per_mesh": true, + "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": true, "settable_globally": true, @@ -936,7 +936,7 @@ "type": "optional_extruder", "default_value": "-1", "value": "top_bottom_extruder_nr", - "settable_per_mesh": true, + "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": true, "settable_globally": true, @@ -989,7 +989,7 @@ "description": "The extruder train used for printing the top and bottom skin. This is used in multi-extrusion.", "type": "optional_extruder", "default_value": "-1", - "settable_per_mesh": true, + "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": true, "settable_globally": true, @@ -1312,7 +1312,7 @@ "description": "The extruder train used for printing infill. This is used in multi-extrusion.", "type": "optional_extruder", "default_value": "-1", - "settable_per_mesh": true, + "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": true, "settable_globally": true, From c614f02d0ff9cbaf8476fb764ac7849c49fc0e45 Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Wed, 6 Sep 2017 16:58:17 +0200 Subject: [PATCH 40/45] Fixed settings update. After each change in the settings the build volume was rebuilding CURA-4271 --- cura/BuildVolume.py | 110 +++++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index bc5398cb1c..ccdc3cea40 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -90,10 +90,15 @@ class BuildVolume(SceneNode): #Objects loaded at the moment. We are connected to the property changed events of these objects. self._scene_objects = set() - self._change_timer = QTimer() - self._change_timer.setInterval(100) - self._change_timer.setSingleShot(True) - self._change_timer.timeout.connect(self._onChangeTimerFinished) + self._scene_change_timer = QTimer() + self._scene_change_timer.setInterval(100) + self._scene_change_timer.setSingleShot(True) + self._scene_change_timer.timeout.connect(self._onSceneChangeTimerFinished) + + self._setting_change_timer = QTimer() + self._setting_change_timer.setInterval(100) + self._setting_change_timer.setSingleShot(True) + self._setting_change_timer.timeout.connect(self._onSettingChangeTimerFinished) self._build_volume_message = Message(catalog.i18nc("@info:status", "The build volume height has been reduced due to the value of the" @@ -104,15 +109,19 @@ class BuildVolume(SceneNode): # activeQualityChanged is always emitted after setActiveVariant, setActiveMaterial and setActiveQuality. # Therefore this works. Application.getInstance().getMachineManager().activeQualityChanged.connect(self._onStackChanged) + # This should also ways work, and it is semantically more correct, # but it does not update the disallowed areas after material change Application.getInstance().getMachineManager().activeStackChanged.connect(self._onStackChanged) + # list of settings which were updated + self._changed_settings_since_last_rebuild = [] + def _onSceneChanged(self, source): if self._global_container_stack: - self._change_timer.start() + self._scene_change_timer.start() - def _onChangeTimerFinished(self): + def _onSceneChangeTimerFinished(self): root = Application.getInstance().getController().getScene().getRoot() new_scene_objects = set(node for node in BreadthFirstIterator(root) if node.callDecoration("isSliceable")) if new_scene_objects != self._scene_objects: @@ -562,42 +571,67 @@ class BuildVolume(SceneNode): self._engine_ready = True self.rebuild() + def _onSettingChangeTimerFinished(self): + rebuild_me = False + update_disallowed_areas = False + update_raft_thickness = False + update_extra_z_clearance = True + for setting_key in self._changed_settings_since_last_rebuild: + if setting_key == "print_sequence": + machine_height = self._global_container_stack.getProperty("machine_height", "value") + if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", + "value") == "one_at_a_time" and len( + self._scene_objects) > 1: + self._height = min(self._global_container_stack.getProperty("gantry_height", "value"), + machine_height) + if self._height < machine_height: + self._build_volume_message.show() + else: + self._build_volume_message.hide() + else: + self._height = self._global_container_stack.getProperty("machine_height", "value") + self._build_volume_message.hide() + rebuild_me = True + + if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence" or setting_key in self._ooze_shield_settings or setting_key in self._distance_settings or setting_key in self._extruder_settings: + update_disallowed_areas = True + rebuild_me = True + + if setting_key in self._raft_settings: + update_raft_thickness = True + rebuild_me = True + + if setting_key in self._extra_z_settings: + update_extra_z_clearance = True + rebuild_me = True + + if setting_key in self._limit_to_extruder_settings: + update_disallowed_areas = True + rebuild_me = True + + # We only want to update all of them once. + if update_disallowed_areas: + self._updateDisallowedAreas() + + if update_raft_thickness: + self._updateRaftThickness() + + if update_extra_z_clearance: + self._updateExtraZClearance() + + if rebuild_me: + self.rebuild() + + # We just did a rebuild, reset the list. + self._changed_settings_since_last_rebuild = [] + def _onSettingPropertyChanged(self, setting_key: str, property_name: str): if property_name != "value": return - rebuild_me = False - if setting_key == "print_sequence": - machine_height = self._global_container_stack.getProperty("machine_height", "value") - if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1: - self._height = min(self._global_container_stack.getProperty("gantry_height", "value"), machine_height) - if self._height < machine_height: - self._build_volume_message.show() - else: - self._build_volume_message.hide() - else: - self._height = self._global_container_stack.getProperty("machine_height", "value") - self._build_volume_message.hide() - rebuild_me = True - - if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence" or setting_key in self._ooze_shield_settings or setting_key in self._distance_settings or setting_key in self._extruder_settings: - self._updateDisallowedAreas() - rebuild_me = True - - if setting_key in self._raft_settings: - self._updateRaftThickness() - rebuild_me = True - - if setting_key in self._extra_z_settings: - self._updateExtraZClearance() - rebuild_me = True - - if setting_key in self._limit_to_extruder_settings: - self._updateDisallowedAreas() - rebuild_me = True - - if rebuild_me: - self.rebuild() + if setting_key not in self._changed_settings_since_last_rebuild: + self._changed_settings_since_last_rebuild.append(setting_key) + self._setting_change_timer.start() def hasErrors(self) -> bool: return self._has_errors From b0916e4b670332e77b2bf17333aa831a22b05f68 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Sep 2017 18:09:18 +0200 Subject: [PATCH 41/45] Fix job name mismatching CURA-4276 --- cura/PrintInformation.py | 59 ++++++++++++++++++++++++-------------- resources/qml/JobSpecs.qml | 23 +++++++-------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index d8c5129527..26f9420120 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -76,11 +76,12 @@ class PrintInformation(QObject): if self._backend: self._backend.printDurationMessage.connect(self._onPrintDurationMessage) - self._job_name = "" + self._base_name = "" self._abbr_machine = "" + self._job_name = "" Application.getInstance().globalContainerStackChanged.connect(self._setAbbreviatedMachineName) - Application.getInstance().fileLoaded.connect(self.setJobName) + Application.getInstance().fileLoaded.connect(self.setBaseName) Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged) @@ -221,16 +222,8 @@ class PrintInformation(QObject): @pyqtSlot(str) def setJobName(self, name): - # Ensure that we don't use entire path but only filename - name = os.path.basename(name) - - # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its - # extension. This cuts the extension off if necessary. - name = os.path.splitext(name)[0] - name = self.createJobName(name) - if self._job_name != name and (self._job_name == "" or name == ""): - self._job_name = name - self.jobNameChanged.emit() + self._job_name = name + self.jobNameChanged.emit() jobNameChanged = pyqtSignal() @@ -238,21 +231,43 @@ class PrintInformation(QObject): def jobName(self): return self._job_name - @pyqtSlot(str, result = str) - def createJobName(self, base_name): - if base_name == "": - return "" - base_name = self._stripAccents(base_name) + def _updateJobName(self): + if self._base_name == "": + self._job_name = "" + self.jobNameChanged.emit() + return + + base_name = self._stripAccents(self._base_name) self._setAbbreviatedMachineName() if self._pre_sliced: - return catalog.i18nc("@label", "Pre-sliced file {0}", base_name) + self._job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) elif Preferences.getInstance().getValue("cura/jobname_prefix"): # Don't add abbreviation if it already has the exact same abbreviation. if base_name.startswith(self._abbr_machine + "_"): - return base_name - return self._abbr_machine + "_" + base_name + self._job_name = base_name + else: + self._job_name = self._abbr_machine + "_" + base_name else: - return base_name + self._job_name = base_name + + self.jobNameChanged.emit() + + @pyqtProperty(str) + def baseName(self): + return self._base_name + + @pyqtSlot(str) + def setBaseName(self, base_name): + # Ensure that we don't use entire path but only filename + name = os.path.basename(base_name) + + # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its + # extension. This cuts the extension off if necessary. + name = os.path.splitext(name)[0] + + if self._base_name == "" and self._base_name != name: + self._base_name = name + self._updateJobName() ## Created an acronymn-like abbreviated machine name from the currently active machine name # Called each time the global stack is switched @@ -277,4 +292,4 @@ class PrintInformation(QObject): ## Utility method that strips accents from characters (eg: รข -> a) def _stripAccents(self, str): - return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn') + return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn') diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index b2f63dc708..0f70022efc 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -13,13 +13,7 @@ Item { id: base property bool activity: CuraApplication.platformActivity - property string fileBaseName - property variant activeMachineName: Cura.MachineManager.activeMachineName - - onActiveMachineNameChanged: - { - printJobTextfield.text = PrintInformation.createJobName(base.fileBaseName); - } + property string fileBaseName: "" UM.I18nCatalog { id: catalog; name:"cura"} @@ -30,23 +24,26 @@ Item { target: backgroundItem onHasMesh: { - base.fileBaseName = name + if (base.fileBaseName == "") + { + base.fileBaseName = name; + } } } onActivityChanged: { if (activity == true && base.fileBaseName == ''){ //this only runs when you open a file from the terminal (or something that works the same way; for example when you drag a file on the icon in MacOS or use 'open with' on Windows) - base.fileBaseName = PrintInformation.jobName; //get the fileBaseName from PrintInformation.py because this saves the filebase when the file is opened using the terminal (or something alike) - printJobTextfield.text = PrintInformation.createJobName(base.fileBaseName); + base.fileBaseName = PrintInformation.baseName; //get the fileBaseName from PrintInformation.py because this saves the filebase when the file is opened using the terminal (or something alike) + PrintInformation.setBaseName(base.fileBaseName); } if (activity == true && base.fileBaseName != ''){ //this runs in all other cases where there is a mesh on the buildplate (activity == true). It uses the fileBaseName from the hasMesh signal - printJobTextfield.text = PrintInformation.createJobName(base.fileBaseName); + PrintInformation.setBaseName(base.fileBaseName); } if (activity == false){ //When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file) - printJobTextfield.text = ''; + PrintInformation.setJobName('') } } @@ -102,7 +99,7 @@ Item { width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) maximumLength: 120 property int unremovableSpacing: 5 - text: '' + text: PrintInformation.jobName horizontalAlignment: TextInput.AlignRight onTextChanged: { PrintInformation.setJobName(text); From a50e228ba1a2436d5509ac4acb373e24dbeda7b2 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 8 Sep 2017 11:56:37 +0200 Subject: [PATCH 42/45] Fix onHover border for extruder buttons CURA-4148 --- resources/qml/SidebarHeader.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index f2fc0c0027..79c6339f0b 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -123,7 +123,8 @@ Column { anchors.fill: parent border.width: UM.Theme.getSize("default_lining").width - border.color: control.hovered ? UM.Theme.getColor("action_button_hovered_border") : + border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : + control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border") color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : From 8264b6fe67f0c8913a79caab36d14659872ada35 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 8 Sep 2017 11:58:24 +0200 Subject: [PATCH 43/45] Fix default action_button color and checkbox onHover color CURA-4148 --- resources/themes/cura-light/theme.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 783d0c9edc..c1c855513f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -123,7 +123,7 @@ "tab_active_text": [24, 41, 77, 255], "tab_background": [245, 245, 245, 255], - "action_button": [242, 242, 242, 255], + "action_button": [255, 255, 255, 255], "action_button_text": [0, 0, 0, 255], "action_button_border": [127, 127, 127, 255], "action_button_hovered": [255, 255, 255, 255], @@ -189,7 +189,7 @@ "slider_text_background": [255, 255, 255, 255], "checkbox": [255, 255, 255, 255], - "checkbox_hover": [68, 72, 75, 255], + "checkbox_hover": [255, 255, 255, 255], "checkbox_border": [64, 69, 72, 255], "checkbox_border_hover": [12, 169, 227, 255], "checkbox_mark": [119, 122, 124, 255], From a485781900883ff2f35401e586e6658659d9e706 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 8 Sep 2017 13:06:08 +0200 Subject: [PATCH 44/45] Add new unknown icon CURA-4148 --- .../cura-light/icons/tab_status_unknown.svg | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/themes/cura-light/icons/tab_status_unknown.svg b/resources/themes/cura-light/icons/tab_status_unknown.svg index 1ba37e06be..f195ae238a 100644 --- a/resources/themes/cura-light/icons/tab_status_unknown.svg +++ b/resources/themes/cura-light/icons/tab_status_unknown.svg @@ -1 +1,15 @@ - \ No newline at end of file + + + + Unknown + Created with Sketch. + + + + + + + + + + \ No newline at end of file From 748c72760bb18e9d64e9607a0a13c89839da6f1f Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 8 Sep 2017 13:53:21 +0200 Subject: [PATCH 45/45] Typo --- resources/qml/SidebarHeader.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 79c6339f0b..d42fc8b262 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -377,7 +377,7 @@ Column { id: materialInfoLabel wrapMode: Text.WordWrap - text: catalog.i18nc("@label", "Check material compability") + text: catalog.i18nc("@label", "Check material compatibility") font: UM.Theme.getFont("default"); verticalAlignment: Text.AlignTop anchors.top: parent.top