From 554f580f131b5db521c1a03eaaf1c2209202f564 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 5 Oct 2021 17:28:26 +0200 Subject: [PATCH] Add extra card to refresh printer list Contributes to issue CURA-8609. --- .../Materials/MaterialsSyncDialog.qml | 65 +++++++++++++++++++ .../cura-light/icons/default/EmptyInfo.svg | 3 + 2 files changed, 68 insertions(+) create mode 100644 resources/themes/cura-light/icons/default/EmptyInfo.svg diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index e7e8b1f2aa..06a26b2ad4 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -199,6 +199,7 @@ Window ListView { + id: printerList width: parent.width spacing: UM.Theme.getSize("default_margin").height @@ -257,6 +258,70 @@ Window } } } + + footer: Item + { + width: printerListScrollView.width + height: UM.Theme.getSize("card").height + UM.Theme.getSize("default_margin").height + Rectangle + { + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + anchors.fill: parent + anchors.topMargin: UM.Theme.getSize("default_margin").height + + RowLayout + { + anchors + { + fill: parent + leftMargin: (parent.height - infoIcon.height) / 2 //Same margin on the left as top and bottom. + rightMargin: (parent.height - infoIcon.height) / 2 + } + spacing: UM.Theme.getSize("default_margin").width + + Rectangle //Info icon with a themeable color and background. + { + id: infoIcon + width: UM.Theme.getSize("machine_selector_icon").width + height: width + Layout.preferredWidth: width + Layout.alignment: Qt.AlignVCenter + radius: height / 2 + color: UM.Theme.getColor("warning") + + UM.RecolorImage + { + source: UM.Theme.getIcon("EmptyInfo") + anchors.fill: parent + color: UM.Theme.getColor("machine_selector_printer_icon") + } + } + + Label + { + text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") + + "\n" + + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") + font: UM.Theme.getFont("medium") + elide: Text.ElideRight + + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + } + + Cura.SecondaryButton + { + id: refreshListButton + text: catalog.i18nc("@button", "Refresh List") + iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight") + + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: width + } + } + } + } } } Cura.TertiaryButton diff --git a/resources/themes/cura-light/icons/default/EmptyInfo.svg b/resources/themes/cura-light/icons/default/EmptyInfo.svg new file mode 100644 index 0000000000..49d67746d1 --- /dev/null +++ b/resources/themes/cura-light/icons/default/EmptyInfo.svg @@ -0,0 +1,3 @@ + + +