From 7ffa770fb47c2a4acbb0700378ef0b96ea519523 Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 10:35:00 +0200 Subject: Searching container registry returns ContainerStacks. Made typing more generic to work with an ContainerStack to compensate. Made AbstractMachine getMachines a classmethod so it can be called with ContainerStacks. CURA-9514 --- resources/qml/PrinterSelector/MachineSelectorList.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index ae2706f9ab..822bdad3c5 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -10,7 +10,7 @@ import Cura 1.0 as Cura ListView { id: listView - model: Cura.GlobalStacksModel {} + model: Cura.AbstractStacksModel {} section.property: "hasRemoteConnection" property real contentHeight: childrenRect.height -- cgit v1.2.3 From b18080c332ed945a55d301da6354a9f6820b5ad2 Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 14:29:05 +0200 Subject: Rename AbstractStacksModel.py -> MachineListModel.py since this model includes both abstract machine stacks and regular machines Add machineCount for displaying the number of machines of a type. MachineSelectorButton is in use in other places, swapped it out for a new Component MachineListButton. CURA-9514 --- .../qml/PrinterSelector/MachineListButton.qml | 88 ++++++++++++++++++++++ .../qml/PrinterSelector/MachineSelectorList.qml | 9 +-- resources/qml/qmldir | 1 + resources/themes/cura-light/theme.json | 3 + 4 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 resources/qml/PrinterSelector/MachineListButton.qml (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml new file mode 100644 index 0000000000..b6b7f4c1dd --- /dev/null +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -0,0 +1,88 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.5 as UM +import Cura 1.0 as Cura + + +Button +{ + id: machineListButton + + width: parent.width + height: UM.Theme.getSize("large_button").height + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width + checkable: true + hoverEnabled: true + + contentItem: Item + { + width: machineListButton.width - machineListButton.leftPadding - machineListButton.rightPadding + height: UM.Theme.getSize("action_button").height + + UM.ColorImage + { + id: printerIcon + height: UM.Theme.getSize("medium_button").height + width: UM.Theme.getSize("medium_button").width + color: UM.Theme.getColor("machine_selector_printer_icon") + visible: model.machineType == "abstract_machine" + source: model.machineType == "abstract_machine" ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium") + + anchors + { + left: parent.left + verticalCenter: parent.verticalCenter + } + } + + UM.Label + { + id: buttonText + anchors + { + left: printerIcon.right + right: printerCount.left + verticalCenter: parent.verticalCenter + leftMargin: UM.Theme.getSize("default_margin").width + } + text: machineListButton.text + font: model.machineType == "abstract_machine" ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") + visible: text != "" + elide: Text.ElideRight + } + + Rectangle + { + id: printerCount + color: UM.Theme.getColor("background_2") + radius: height + width: height + anchors + { + right: parent.right + top: buttonText.top + bottom: buttonText.bottom + verticalCenter: parent.verticalCenter + } + visible: model.machineType == "abstract_machine" + + UM.Label + { + text: model.machineCount + anchors.centerIn: parent + font: UM.Theme.getFont("default_bold") + } + } + } + + background: Rectangle + { + id: backgroundRect + color: machineListButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent" + } +} diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index 822bdad3c5..de14846fb7 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -10,8 +10,8 @@ import Cura 1.0 as Cura ListView { id: listView - model: Cura.AbstractStacksModel {} - section.property: "hasRemoteConnection" + model: Cura.MachineListModel {} + section.property: "section" property real contentHeight: childrenRect.height ScrollBar.vertical: UM.ScrollBar @@ -29,13 +29,10 @@ ListView color: UM.Theme.getColor("text_medium") } - delegate: MachineSelectorButton + delegate: MachineListButton { text: model.name ? model.name : "" width: listView.width - scrollBar.width - outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null - - checked: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.id == model.id : false onClicked: { diff --git a/resources/qml/qmldir b/resources/qml/qmldir index a47d85545b..6ec3ca91c8 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -2,6 +2,7 @@ module Cura MachineSelector 1.0 MachineSelector.qml MachineSelectorButton 1.0 MachineSelectorButton.qml +MachineListButton 1.0 MachineListButton.qml CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml PrintSetupSelector 1.0 PrintSetupSelector.qml ProfileOverview 1.6 ProfileOverview.qml diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e7622bc685..84dfdd5fc2 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -564,6 +564,9 @@ "medium_button": [2.5, 2.5], "medium_button_icon": [2, 2], + "large_button": [3.5, 3.5], + "large_button_icon": [2.8, 2.8], + "context_menu": [20, 2], "icon_indicator": [1, 1], -- cgit v1.2.3 From 93e2bef30342c62ddd074e4dac7998c1dbae133d Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 15:44:16 +0200 Subject: Group printers by section (Connected Printers/Other Printers) Cleanup redundant code. CURA-9514 --- resources/qml/PrinterSelector/MachineListButton.qml | 1 - resources/qml/PrinterSelector/MachineSelectorList.qml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index b6b7f4c1dd..c3257cfa15 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -67,7 +67,6 @@ Button right: parent.right top: buttonText.top bottom: buttonText.bottom - verticalCenter: parent.verticalCenter } visible: model.machineType == "abstract_machine" diff --git a/resources/qml/PrinterSelector/MachineSelectorList.qml b/resources/qml/PrinterSelector/MachineSelectorList.qml index de14846fb7..06c2fdb40c 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -11,7 +11,7 @@ ListView { id: listView model: Cura.MachineListModel {} - section.property: "section" + section.property: "isOnline" property real contentHeight: childrenRect.height ScrollBar.vertical: UM.ScrollBar @@ -21,7 +21,7 @@ ListView section.delegate: UM.Label { - text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Preset printers") + text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Other printers") width: parent.width - scrollBar.width height: UM.Theme.getSize("action_button").height leftPadding: UM.Theme.getSize("default_margin").width -- cgit v1.2.3 From e541890c07eaae7dd6d3cf5fbf358b0225526b3f Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 15:56:50 +0200 Subject: Fix drop down not dynamically resizing width CURA-9514 --- resources/qml/PrinterSelector/MachineSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 77cd2be409..09ca1316be 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -192,7 +192,7 @@ Cura.ExpandablePopup contentItem: Item { id: popup - implicitWidth: UM.Theme.getSize("machine_selector_widget_content").width + implicitWidth: machineSelector.width implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry. MachineSelectorList { -- cgit v1.2.3 From 790c373b38546df9f3a046772ad910c330b6e97f Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 15:57:40 +0200 Subject: Show icon for offline printers CURA-9514 --- resources/qml/PrinterSelector/MachineListButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index c3257cfa15..03999c4d17 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -30,7 +30,7 @@ Button height: UM.Theme.getSize("medium_button").height width: UM.Theme.getSize("medium_button").width color: UM.Theme.getColor("machine_selector_printer_icon") - visible: model.machineType == "abstract_machine" + visible: model.machineType == "abstract_machine" || !model.isOnline source: model.machineType == "abstract_machine" ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium") anchors -- cgit v1.2.3 From 90f53bbdc1564cd66f95f7f4a14a15831fd13bcb Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 16:01:30 +0200 Subject: Adjust large button size CURA-9514 --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 84dfdd5fc2..809bcfdee8 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -564,7 +564,7 @@ "medium_button": [2.5, 2.5], "medium_button_icon": [2, 2], - "large_button": [3.5, 3.5], + "large_button": [3.0, 3.0], "large_button_icon": [2.8, 2.8], "context_menu": [20, 2], -- cgit v1.2.3 From db0b6687392a0d88bbdae37aa5a7f035bffba3a8 Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Tue, 23 Aug 2022 16:17:36 +0200 Subject: Adjust button size according to width CURA-9514 --- resources/qml/PrinterSelector/MachineSelector.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 09ca1316be..8c5ed98887 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -224,6 +224,9 @@ Cura.ExpandablePopup anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter + anchors.left: parent.left + anchors.right: parent.right + padding: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width @@ -236,7 +239,7 @@ Cura.ExpandablePopup // The maximum width of the button is half of the total space, minus the padding of the parent, the left // padding of the component and half the spacing because of the space between buttons. fixedWidthMode: true - width: UM.Theme.getSize("machine_selector_widget_content").width / 2 - leftPadding + width: buttonRow.width / 2 - leftPadding * 1.5 onClicked: { toggleContent() @@ -253,7 +256,7 @@ Cura.ExpandablePopup fixedWidthMode: true // The maximum width of the button is half of the total space, minus the padding of the parent, the right // padding of the component and half the spacing because of the space between buttons. - width: UM.Theme.getSize("machine_selector_widget_content").width / 2 - leftPadding + width: buttonRow.width / 2 - rightPadding * 1.5 onClicked: { toggleContent() -- cgit v1.2.3 From 721f63b0d1b920b0363bf694d708de8fc0ae053d Mon Sep 17 00:00:00 2001 From: joeydelarago Date: Wed, 24 Aug 2022 10:06:03 +0200 Subject: Give machine selector minimum width so it displays correctly on smaller screens. CURA-9514 --- resources/qml/PrinterSelector/MachineSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 8c5ed98887..869d536a00 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -192,7 +192,7 @@ Cura.ExpandablePopup contentItem: Item { id: popup - implicitWidth: machineSelector.width + implicitWidth: Math.max(machineSelector.width, UM.Theme.getSize("machine_selector_widget_content").width) implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry. MachineSelectorList { -- cgit v1.2.3 From 2013ad6baf7d77601087b6dcc6ba35c9e7f4f6cc Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Wed, 24 Aug 2022 14:22:17 +0200 Subject: Update resources/qml/PrinterSelector/MachineListButton.qml Co-authored-by: Casper Lamboo --- resources/qml/PrinterSelector/MachineListButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index 03999c4d17..4511c72b4c 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -- cgit v1.2.3 From 03c88c18e6523ad370f094730d43f85e90d3a390 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 24 Aug 2022 16:51:47 +0200 Subject: Bump up the maximum_extrusion_area_deviation CURA-9524 Fixes #12828 --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'resources') diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index ce641cf032..4a40d1855a 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6442,10 +6442,10 @@ "description": "The maximum extrusion area deviation allowed when removing intermediate points from a straight line. An intermediate point may serve as width-changing point in a long straight line. Therefore, if it is removed, it will cause the line to have a uniform width and, as a result, lose (or gain) a bit of extrusion area. If you increase this you may notice slight under- (or over-) extrusion in between straight parallel walls, as more intermediate width-changing points will be allowed to be removed. Your print will be less accurate, but the g-code will be smaller.", "type": "float", "unit": "μm²", - "default_value": 2000, + "default_value": 50000, "minimum_value": "0", "minimum_value_warning": "500", - "maximum_value_warning": "50000", + "maximum_value_warning": "100000", "settable_per_mesh": true } } -- cgit v1.2.3 From 8b84db705943217072003bec7d97439506a91eb0 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Fri, 26 Aug 2022 10:45:45 +0200 Subject: Remove AbstractMachine Having a separate class for the AbstractMachine complicated things; it's behaviour was extremely similar to the GlobalStack so adding one more stack container type in addition to the many similar setting container types we already have adds complexity to the system. Having these different classes for machines and abstract machines also add complexity to the update script as the abstract machines were stored in a separate folder from the machine types. Because of these reasons we decided to replace the AbstractMachine by a GlobalStack where the is_abstract_machine property metadata property is set to True. CURA-9514, CURA-9277 Co-authored-by: joeydelarago --- resources/qml/PrinterSelector/MachineListButton.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'resources') diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index 4511c72b4c..55ae5497d9 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -30,8 +30,8 @@ Button height: UM.Theme.getSize("medium_button").height width: UM.Theme.getSize("medium_button").width color: UM.Theme.getColor("machine_selector_printer_icon") - visible: model.machineType == "abstract_machine" || !model.isOnline - source: model.machineType == "abstract_machine" ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium") + visible: model.isAbstractMachine || !model.isOnline + source: model.isAbstractMachine ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium") anchors { @@ -51,7 +51,7 @@ Button leftMargin: UM.Theme.getSize("default_margin").width } text: machineListButton.text - font: model.machineType == "abstract_machine" ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") + font: model.isAbstractMachine ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") visible: text != "" elide: Text.ElideRight } @@ -68,7 +68,7 @@ Button top: buttonText.top bottom: buttonText.bottom } - visible: model.machineType == "abstract_machine" + visible: model.isAbstractMachine UM.Label { -- cgit v1.2.3