diff options
author | c.lamboo <casperlamboo@gmail.com> | 2022-08-31 17:05:00 +0300 |
---|---|---|
committer | c.lamboo <casperlamboo@gmail.com> | 2022-08-31 17:05:00 +0300 |
commit | c73b980a3d483247ad339c46263c5d0fd514cab2 (patch) | |
tree | d0230adf7af44ce4dd10058764a2e5d315aaaf7d /resources | |
parent | 60a670f2ed300d4e4919fece74f9342436d2cbe6 (diff) | |
parent | ded387324985b52632cab5eaa1343e6e239fcb1c (diff) |
Merge branch 'main' into CURA-9422_abstract_cloud_monitor_redux
# Conflicts:
# resources/qml/PrinterSelector/MachineListButton.qml
Diffstat (limited to 'resources')
-rw-r--r-- | resources/definitions/fdmprinter.def.json | 112 | ||||
-rw-r--r-- | resources/qml/PrinterSelector/MachineListButton.qml | 172 | ||||
-rw-r--r-- | resources/qml/PrinterSelector/MachineSelectorList.qml | 20 |
3 files changed, 184 insertions, 120 deletions
diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index d5bcc2b7bc..dcedb79118 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1443,7 +1443,63 @@ "value": "0", "limit_to_extruder": "roofing_extruder_nr", "settable_per_mesh": true, - "enabled": "top_layers > 0" + "enabled": "top_layers > 0", + "children": { + "roofing_line_width": + { + "label": "Top Surface Skin Line Width", + "description": "Width of a single line of the areas at the top of the print.", + "unit": "mm", + "minimum_value": "0.001", + "minimum_value_warning": "0.1 + 0.4 * machine_nozzle_size", + "maximum_value_warning": "2 * machine_nozzle_size", + "default_value": 0.4, + "type": "float", + "value": "skin_line_width", + "limit_to_extruder": "roofing_extruder_nr", + "settable_per_mesh": true, + "enabled": "roofing_layer_count > 0 and top_layers > 0" + }, + "roofing_pattern": + { + "label": "Top Surface Skin Pattern", + "description": "The pattern of the top most layers.", + "type": "enum", + "options": + { + "lines": "Lines", + "concentric": "Concentric", + "zigzag": "Zig Zag" + }, + "default_value": "lines", + "value": "top_bottom_pattern", + "limit_to_extruder": "roofing_extruder_nr", + "settable_per_mesh": true, + "enabled": "roofing_layer_count > 0 and top_layers > 0" + }, + "roofing_monotonic": + { + "label": "Monotonic Top Surface Order", + "description": "Print top surface lines in an ordering that causes them to always overlap with adjacent lines in a single direction. This takes slightly more time to print, but makes flat surfaces look more consistent.", + "type": "bool", + "default_value": false, + "value": "skin_monotonic", + "enabled": "roofing_layer_count > 0 and top_layers > 0 and roofing_pattern != 'concentric'", + "limit_to_extruder": "roofing_extruder_nr", + "settable_per_mesh": true + }, + "roofing_angles": + { + "label": "Top Surface Skin Line Directions", + "description": "A list of integer line directions to use when the top surface skin layers use the lines or zig zag pattern. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees).", + "type": "[int]", + "default_value": "[ ]", + "value": "skin_angles", + "enabled": "roofing_pattern != 'concentric' and roofing_layer_count > 0 and top_layers > 0", + "limit_to_extruder": "roofing_extruder_nr", + "settable_per_mesh": true + } + } }, "top_bottom_extruder_nr": { @@ -6646,60 +6702,6 @@ "default_value": "middle", "settable_per_mesh": true }, - "roofing_line_width": - { - "label": "Top Surface Skin Line Width", - "description": "Width of a single line of the areas at the top of the print.", - "unit": "mm", - "minimum_value": "0.001", - "minimum_value_warning": "0.1 + 0.4 * machine_nozzle_size", - "maximum_value_warning": "2 * machine_nozzle_size", - "default_value": 0.4, - "type": "float", - "value": "skin_line_width", - "limit_to_extruder": "roofing_extruder_nr", - "settable_per_mesh": true, - "enabled": "roofing_layer_count > 0 and top_layers > 0" - }, - "roofing_pattern": - { - "label": "Top Surface Skin Pattern", - "description": "The pattern of the top most layers.", - "type": "enum", - "options": - { - "lines": "Lines", - "concentric": "Concentric", - "zigzag": "Zig Zag" - }, - "default_value": "lines", - "value": "top_bottom_pattern", - "limit_to_extruder": "roofing_extruder_nr", - "settable_per_mesh": true, - "enabled": "roofing_layer_count > 0 and top_layers > 0" - }, - "roofing_monotonic": - { - "label": "Monotonic Top Surface Order", - "description": "Print top surface lines in an ordering that causes them to always overlap with adjacent lines in a single direction. This takes slightly more time to print, but makes flat surfaces look more consistent.", - "type": "bool", - "default_value": false, - "value": "skin_monotonic", - "enabled": "roofing_layer_count > 0 and top_layers > 0 and roofing_pattern != 'concentric'", - "limit_to_extruder": "roofing_extruder_nr", - "settable_per_mesh": true - }, - "roofing_angles": - { - "label": "Top Surface Skin Line Directions", - "description": "A list of integer line directions to use when the top surface skin layers use the lines or zig zag pattern. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees).", - "type": "[int]", - "default_value": "[ ]", - "value": "skin_angles", - "enabled": "roofing_pattern != 'concentric' and roofing_layer_count > 0 and top_layers > 0", - "limit_to_extruder": "roofing_extruder_nr", - "settable_per_mesh": true - }, "infill_enable_travel_optimization": { "label": "Infill Travel Optimization", diff --git a/resources/qml/PrinterSelector/MachineListButton.qml b/resources/qml/PrinterSelector/MachineListButton.qml index 1ed9f98c46..70e7564aa9 100644 --- a/resources/qml/PrinterSelector/MachineListButton.qml +++ b/resources/qml/PrinterSelector/MachineListButton.qml @@ -7,81 +7,133 @@ import QtQuick.Controls 2.3 import UM 1.5 as UM import Cura 1.0 as Cura - -Button -{ - id: machineListButton - +Loader { + id: loader 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 + sourceComponent: { + switch (model.componentType) { + case "HIDE_BUTTON": + hideButtonComponent + break; + case "SHOW_BUTTON": + showButtonComponent + break; + case "MACHINE": + machineListButtonComponent + break; + default: + } + } + property var onClicked - contentItem: Item + Component { - width: machineListButton.width - machineListButton.leftPadding - machineListButton.rightPadding - height: UM.Theme.getSize("action_button").height - - UM.ColorImage + id: hideButtonComponent + Cura.TertiaryButton { - 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.isAbstractMachine || !model.isOnline - source: model.isAbstractMachine ? UM.Theme.getIcon("PrinterTriple", "medium") : UM.Theme.getIcon("Printer", "medium") - - anchors - { - left: parent.left - verticalCenter: parent.verticalCenter - } + text: catalog.i18nc("@label", "Hide all connected printers") + height: UM.Theme.getSize("large_button").height + onClicked: if (loader.onClicked) loader.onClicked() + iconSource: UM.Theme.getIcon("ChevronSingleUp") + width: parent.width } + } - UM.Label + Component + { + id: showButtonComponent + Cura.TertiaryButton { - id: buttonText - anchors - { - left: printerIcon.right - right: printerCount.left - verticalCenter: parent.verticalCenter - leftMargin: UM.Theme.getSize("default_margin").width - } - text: machineListButton.text - font: model.isAbstractMachine ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium") - visible: text != "" - elide: Text.ElideRight + text: catalog.i18nc("@label", "Show all connected printers") + height: UM.Theme.getSize("large_button").height + onClicked: if (loader.onClicked) loader.onClicked() + iconSource: UM.Theme.getIcon("ChevronSingleDown") + width: parent.width } + } - Rectangle + Component + { + id: machineListButtonComponent + + Button { - id: printerCount - color: UM.Theme.getColor("background_2") - radius: height - width: height - anchors + id: machineListButton + + onClicked: if (loader.onClicked) loader.onClicked() + + 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 { - right: parent.right - top: buttonText.top - bottom: buttonText.bottom + 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.isAbstractMachine || !model.isOnline + source: model.isAbstractMachine ? 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: model.name ? model.name : "" + font: model.isAbstractMachine ? 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 + } + visible: model.isAbstractMachine ? model.isAbstractMachine : false + + UM.Label + { + text: model.machineCount ? model.machineCount : "" + anchors.centerIn: parent + font: UM.Theme.getFont("default_bold") + } + } } - visible: model.isAbstractMachine ? model.isAbstractMachine : false - UM.Label + background: Rectangle { - text: model.machineCount ? model.machineCount : "" - anchors.centerIn: parent - font: UM.Theme.getFont("default_bold") + id: backgroundRect + color: machineListButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent" } } } - - 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 06c2fdb40c..a328ae69d9 100644 --- a/resources/qml/PrinterSelector/MachineSelectorList.qml +++ b/resources/qml/PrinterSelector/MachineSelectorList.qml @@ -22,8 +22,8 @@ ListView section.delegate: UM.Label { 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 + width: parent.width - scrollBar.width leftPadding: UM.Theme.getSize("default_margin").width font: UM.Theme.getFont("medium") color: UM.Theme.getColor("text_medium") @@ -31,13 +31,23 @@ ListView delegate: MachineListButton { - text: model.name ? model.name : "" width: listView.width - scrollBar.width - onClicked: + onClicked: function() { - toggleContent() - Cura.MachineManager.setActiveMachine(model.id) + switch (model.componentType) { + case "HIDE_BUTTON": + listView.model.setShowCloudPrinters(false); + break; + case "SHOW_BUTTON": + listView.model.setShowCloudPrinters(true); + break; + case "MACHINE": + toggleContent() + Cura.MachineManager.setActiveMachine(model.id) + break; + default: + } } } } |