diff options
author | Vandresc <77665581+Vandresc@users.noreply.github.com> | 2022-09-20 11:28:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 11:28:31 +0300 |
commit | 428e78f36f6cfd9df0f9a39aed76f57af6a8e3f1 (patch) | |
tree | 1207cbf0fe2f3f796eeef225b65664856b68b604 /resources | |
parent | 634ceb984b2c19c2b5e7c57fd6503c260d1bd070 (diff) | |
parent | 1dc42cb69aa0333a676de6e93f665956c53ac905 (diff) |
Merge pull request #13304 from Ultimaker/CURA-9278_UI_UX_Fixes
UI / UX fixes for printer selection card
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/Dialogs/ChoosePrinterDialog.qml | 10 | ||||
-rw-r--r-- | resources/qml/PrinterSelector/PrintSelectorCard.qml | 14 |
2 files changed, 14 insertions, 10 deletions
diff --git a/resources/qml/Dialogs/ChoosePrinterDialog.qml b/resources/qml/Dialogs/ChoosePrinterDialog.qml index b7079fcabd..69d9fc44cc 100644 --- a/resources/qml/Dialogs/ChoosePrinterDialog.qml +++ b/resources/qml/Dialogs/ChoosePrinterDialog.qml @@ -11,7 +11,7 @@ import Cura 1.0 as Cura UM.Dialog { property var manager - + property var compatible_machine_model: Cura.CompatibleMachineModel {} id: base title: catalog.i18nc("@title:window", "Select Printer") @@ -65,7 +65,11 @@ UM.Dialog color: UM.Theme.getColor("text_link") hoverColor: UM.Theme.getColor("text_scene_hover") - onClicked: manager.refresh() + onClicked: + { + manager.refresh() + base.compatible_machine_model.forceUpdate() + } } } @@ -73,7 +77,7 @@ UM.Dialog { id: contents - model: Cura.CompatibleMachineModel {} + model: base.compatible_machine_model delegate: Cura.PrintSelectorCard { diff --git a/resources/qml/PrinterSelector/PrintSelectorCard.qml b/resources/qml/PrinterSelector/PrintSelectorCard.qml index 517a0e164a..943ad8077c 100644 --- a/resources/qml/PrinterSelector/PrintSelectorCard.qml +++ b/resources/qml/PrinterSelector/PrintSelectorCard.qml @@ -15,6 +15,7 @@ Rectangle property var extruders property var manager + width: parent.width height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height @@ -35,7 +36,7 @@ Rectangle Layout.preferredWidth: parent.width / 3 Layout.fillWidth: true - Layout.alignment: Qt.AlignTop + Layout.alignment: extruders[0].materials.length > 1 ? Qt.AlignTop: Qt.AlignCenter Layout.fillHeight: false source: UM.Theme.getIcon("Printer") @@ -50,7 +51,7 @@ Rectangle Layout.fillWidth: true Layout.preferredWidth: parent.width / 2 Layout.alignment: Qt.AlignTop - spacing: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("narrow_margin").width Repeater { @@ -88,7 +89,6 @@ Rectangle text: modelData.materials.length == 1 ? `${modelData.materials[0].brand} ${modelData.materials[0].name}` : "" visible: modelData.materials.length == 1 } - ColumnLayout { id: multiMaterialText @@ -98,7 +98,7 @@ Rectangle visible: modelData.materials.length > 1 Repeater { - model: modelData.materials + model: modelData.materials.length > 1 ? modelData.materials: null UM.Label { text: `${modelData.brand} ${modelData.name}` @@ -113,9 +113,9 @@ Rectangle { id: printButton - implicitWidth: UM.Theme.getSize("medium_button").width + implicitWidth: UM.Theme.getSize("large_button").width implicitHeight: implicitWidth - Layout.alignment: Qt.AlignTop + Layout.alignment: extruders[0].materials.length > 1 ? Qt.AlignTop: Qt.AlignCenter padding: 0 background: Rectangle @@ -132,7 +132,7 @@ Rectangle anchors.centerIn: parent source: UM.Theme.getIcon("Printer") color: UM.Theme.getColor("border_accent_1") - width: UM.Theme.getSize("small_button_icon").width + width: UM.Theme.getSize("medium_button_icon").width height: width } } |