From f0966b1c578b8c56ead7baf0aabd098674b415f5 Mon Sep 17 00:00:00 2001 From: jspijker Date: Tue, 8 Nov 2022 18:17:41 +0100 Subject: [PATCH 01/10] Don't stretch in height and adhere border to UX design Contributes to CURA-8689 --- .../qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml | 3 +++ resources/qml/WelcomePages/PrinterCard.qml | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml b/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml index 0e88e0373f..27da8444bf 100644 --- a/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml @@ -50,6 +50,8 @@ Control PrinterCard { id: ultimakerPrinterCard + Layout.alignment: Qt.AlignBottom + borderHeight: thrirdPartyPrinterCard.height onClicked: goToUltimakerPrinter text: catalog.i18nc("@button", "Ultimaker printer") imageSource: UM.Theme.getImage("ultimaker_printer") @@ -58,6 +60,7 @@ Control PrinterCard { id: thrirdPartyPrinterCard + Layout.alignment: Qt.AlignBottom onClicked: goToThirdPartyPrinter text: catalog.i18nc("@button", "Non Ultimaker printer") imageSource: UM.Theme.getImage("third_party_printer") diff --git a/resources/qml/WelcomePages/PrinterCard.qml b/resources/qml/WelcomePages/PrinterCard.qml index 6b0a5bb526..406da371ce 100644 --- a/resources/qml/WelcomePages/PrinterCard.qml +++ b/resources/qml/WelcomePages/PrinterCard.qml @@ -13,6 +13,7 @@ Control id: root property alias text: link_text.text property alias imageSource: image.source + property alias borderHeight: background.height property var onClicked states: @@ -42,7 +43,6 @@ Control onClicked: root.onClicked && root.onClicked() } - topPadding: UM.Theme.getSize("wide_margin").height rightPadding: UM.Theme.getSize("wide_margin").width bottomPadding: UM.Theme.getSize("wide_margin").height leftPadding: UM.Theme.getSize("wide_margin").width @@ -50,7 +50,8 @@ Control background: Rectangle { id: background - anchors.fill: parent + anchors.bottom: column.bottom + height: parent.height border.color: UM.Theme.getColor("primary_button") color: "transparent" border.width: 1 @@ -59,6 +60,7 @@ Control contentItem: ColumnLayout { + id: column spacing: UM.Theme.getSize("wide_margin").height height: childrenRect.height width: childrenRect.width @@ -68,7 +70,6 @@ Control id: image source: imageSource width: 180 * screenScaleFactor - height: 180 * screenScaleFactor sourceSize.width: width sourceSize.height: height } From a3f259d0041afba7150444c882e708fe43392d4b Mon Sep 17 00:00:00 2001 From: jspijker Date: Tue, 8 Nov 2022 18:27:09 +0100 Subject: [PATCH 02/10] Send user to external DF printer page Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index a2b08a45b6..3ebe372550 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -113,13 +113,7 @@ Control id: signInButton Layout.alignment: Qt.AlignRight text: catalog.i18nc("@button", "Sign in to Digital Factory") - onClicked: function() - { - text = catalog.i18nc("@button", "Waiting for new printers") - busy = true; - enabled = false; - Cura.API.account.login(); - } + onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add-printer?utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer") } } } From e9a1806570322109085ffb2e7b47c0dbf6ad8009 Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 07:28:46 +0100 Subject: [PATCH 03/10] Allign "learn more" left-side Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index 3ebe372550..4fe0e028aa 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -83,6 +83,7 @@ Control id: learnMoreButton Layout.fillWidth: true Layout.alignment: Qt.AlignTop + leftPadding: 0 text: catalog.i18nc("@button", "Learn more") iconSource: UM.Theme.getIcon("LinkExternal") isIconOnRightSide: true From 2ef0c3d163fbaacb24f28fa66bb57b6d2911e9a5 Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 07:40:44 +0100 Subject: [PATCH 04/10] Don't trigger third-party printer dialog when onCloudPrintersDetected changed That signal is received basically every minute when you're already signed in and it will close the dialog when no new cloud printers are found. Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index 4fe0e028aa..a8a1c65af7 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -22,10 +22,6 @@ Control { base.goToPage("add_cloud_printers") } - else - { - goToThirdPartyPrinter() - } } contentItem: ColumnLayout From f2147bb259a92d18984bef7906e66a7d2281bb47 Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 10:09:22 +0100 Subject: [PATCH 05/10] Enumerate steps Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index a8a1c65af7..015ecf0f64 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -66,9 +66,9 @@ Control wrapMode: Text.WordWrap text: { const steps = [ - catalog.i18nc("@info", "Sign in into Ultimaker Digilal Factory"), - catalog.i18nc("@info", "Follow the procedure to add a new printer"), - catalog.i18nc("@info", "Your new printer will automatically appear in Cura"), + catalog.i18nc("@info", "1. Sign in into Ultimaker Digilal Factory"), + catalog.i18nc("@info", "2. Follow the procedure to add a new printer"), + catalog.i18nc("@info", "3. Your new printer will automatically appear in Cura"), ]; return steps.join("
"); } From adf2c1636083753292dd708560b352d8d0089599 Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 11:13:40 +0100 Subject: [PATCH 06/10] Fixed printer buttons conform UX design Contributes to CURA-8689 --- .../AddUltimakerOrThirdPartyPrinter.qml | 1 - resources/qml/WelcomePages/PrinterCard.qml | 2 - .../cura-light/images/third_party_printer.svg | 62 ++++++++++++++++++- .../cura-light/images/ultimaker_printer.svg | 36 ++++++++++- 4 files changed, 95 insertions(+), 6 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml b/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml index 27da8444bf..c76979fecf 100644 --- a/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerOrThirdPartyPrinter.qml @@ -51,7 +51,6 @@ Control { id: ultimakerPrinterCard Layout.alignment: Qt.AlignBottom - borderHeight: thrirdPartyPrinterCard.height onClicked: goToUltimakerPrinter text: catalog.i18nc("@button", "Ultimaker printer") imageSource: UM.Theme.getImage("ultimaker_printer") diff --git a/resources/qml/WelcomePages/PrinterCard.qml b/resources/qml/WelcomePages/PrinterCard.qml index 406da371ce..8d0cc0dd06 100644 --- a/resources/qml/WelcomePages/PrinterCard.qml +++ b/resources/qml/WelcomePages/PrinterCard.qml @@ -13,7 +13,6 @@ Control id: root property alias text: link_text.text property alias imageSource: image.source - property alias borderHeight: background.height property var onClicked states: @@ -50,7 +49,6 @@ Control background: Rectangle { id: background - anchors.bottom: column.bottom height: parent.height border.color: UM.Theme.getColor("primary_button") color: "transparent" diff --git a/resources/themes/cura-light/images/third_party_printer.svg b/resources/themes/cura-light/images/third_party_printer.svg index d2444d2d28..14e73c2d9e 100644 --- a/resources/themes/cura-light/images/third_party_printer.svg +++ b/resources/themes/cura-light/images/third_party_printer.svg @@ -1,2 +1,60 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/themes/cura-light/images/ultimaker_printer.svg b/resources/themes/cura-light/images/ultimaker_printer.svg index f2184d4bd1..e65682fe53 100644 --- a/resources/themes/cura-light/images/ultimaker_printer.svg +++ b/resources/themes/cura-light/images/ultimaker_printer.svg @@ -1 +1,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 92fb7fd1a6f45563b144d14a590bef694a9fa8ec Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 11:14:28 +0100 Subject: [PATCH 07/10] Show the add printer dialog in the browser Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index 015ecf0f64..f7830fd67a 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -110,7 +110,7 @@ Control id: signInButton Layout.alignment: Qt.AlignRight text: catalog.i18nc("@button", "Sign in to Digital Factory") - onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add-printer?utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer") + onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add_printer=true&utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer") } } } From 7639b0ba199e110f3c865a5820461c99d7c70f77 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 9 Nov 2022 13:29:33 +0100 Subject: [PATCH 08/10] Center align UltiMaker onboarding wizzard-text CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index f7830fd67a..58cd44fbb0 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -35,7 +35,7 @@ Control RowLayout { - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter Image { @@ -47,6 +47,7 @@ Control ColumnLayout { Layout.fillHeight: true + Layout.fillWidth: false Layout.alignment: Qt.AlignVCenter spacing: UM.Theme.getSize("default_margin").height From f1c8d3d9e001bfb01ebd13b4bc7abac18a67f50f Mon Sep 17 00:00:00 2001 From: jspijker Date: Wed, 9 Nov 2022 13:47:32 +0100 Subject: [PATCH 09/10] Show busy indicator Contributes to CURA-8689 --- resources/qml/WelcomePages/AddUltimakerPrinter.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index 58cd44fbb0..acaa938d1f 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -111,7 +111,14 @@ Control id: signInButton Layout.alignment: Qt.AlignRight text: catalog.i18nc("@button", "Sign in to Digital Factory") - onClicked: Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add_printer=true&utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer") + onClicked: function() + { + Qt.openUrlExternally("https://digitalfactory.ultimaker.com/app/printers?add_printer=true&utm_source=cura&utm_medium=software&utm_campaign=onboarding-add-printer") + text = catalog.i18nc("@button", "Waiting for new printers") + busy = true; + enabled = false; + Cura.API.account.login(); + } } } } From f73d192d65232acd14d0d0a695aaf0ccc1475356 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 9 Nov 2022 14:02:43 +0100 Subject: [PATCH 10/10] Use Label for each individual step in add UltiMaker printer CURA-8689 --- .../qml/WelcomePages/AddUltimakerPrinter.qml | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/resources/qml/WelcomePages/AddUltimakerPrinter.qml b/resources/qml/WelcomePages/AddUltimakerPrinter.qml index 58cd44fbb0..7325b77ec8 100644 --- a/resources/qml/WelcomePages/AddUltimakerPrinter.qml +++ b/resources/qml/WelcomePages/AddUltimakerPrinter.qml @@ -53,25 +53,36 @@ Control UM.Label { - Layout.fillWidth: true + Layout.fillWidth: false Layout.alignment: Qt.AlignTop wrapMode: Text.WordWrap font: UM.Theme.getFont("default_bold") text: catalog.i18nc("@label", "If you are trying to add a new Ultimaker printer to Cura") } - UM.Label + ColumnLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop - wrapMode: Text.WordWrap - text: { - const steps = [ - catalog.i18nc("@info", "1. Sign in into Ultimaker Digilal Factory"), - catalog.i18nc("@info", "2. Follow the procedure to add a new printer"), - catalog.i18nc("@info", "3. Your new printer will automatically appear in Cura"), - ]; - return steps.join("
"); + spacing: 0 + + FontMetrics + { + id: fontMetrics + font: UM.Theme.getFont("default") + } + + Repeater { + model: [ + catalog.i18nc("@info", "Sign in into Ultimaker Digilal Factory"), + catalog.i18nc("@info", "Follow the procedure to add a new printer"), + catalog.i18nc("@info", "Your new printer will automatically appear in Cura"), + ] + UM.Label + { + Layout.alignment: Qt.AlignTop + font: fontMetrics.font + Layout.preferredHeight: fontMetrics.height + text: `${index + 1}. ${modelData}` + } } }