From 3cae6d80b9c06dfe1ca04e8bd7d38655d01fc10b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:00:51 +0100 Subject: [PATCH 1/7] Show restart banner only when a restart is required Contributes to issue CURA-8587. --- plugins/Marketplace/resources/qml/Marketplace.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 62f9673072..bda153ee23 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -232,7 +232,7 @@ Window { height: quitButton.height + 2 * UM.Theme.getSize("default_margin").width color: UM.Theme.getColor("primary") - visible: false // TODO: enable this when restart is required + visible: CuraApplication.getPackageManager().hasPackagesToRemoveOrInstall anchors { left: parent.left From 3c5496441761f7475428b33d444a1c8050d8a980 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:02:42 +0100 Subject: [PATCH 2/7] Use same content for button as old one So make it dynamic based on the application name. This also causes the translation to be re-used. Contributes to issue CURA-8587. --- plugins/Marketplace/resources/qml/Marketplace.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index bda153ee23..e765f0f009 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -270,7 +270,7 @@ Window Cura.SecondaryButton { id: quitButton - text: catalog.i18nc("@button", "Quit Ultimaker Cura") + text: catalog.i18nc("@info:button, %1 is the application name", "Quit %1").arg(CuraApplication.applicationDisplayName) } } } From e646d53b539aacd2b0daea0a18fe15e1cb70c95a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:05:38 +0100 Subject: [PATCH 3/7] Make quit button quit Cura Contributes to issue CURA-8587. --- plugins/Marketplace/resources/qml/Marketplace.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index e765f0f009..cde33faa97 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -271,6 +271,11 @@ Window { id: quitButton text: catalog.i18nc("@info:button, %1 is the application name", "Quit %1").arg(CuraApplication.applicationDisplayName) + onClicked: + { + marketplaceDialog.hide(); + CuraApplication.closeApplication(); + } } } } From e3eb82b022f19d6f13cba5ff8be0858fed2f43ef Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:21:58 +0100 Subject: [PATCH 4/7] Align read more label to the text, not the parent box This is the same alignment as the ellipsis shown when the description is abbreviated. Looks correct, and it should be correct. Contributes to issue CURA-8587. --- plugins/Marketplace/resources/qml/PackageCard.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index bf0dda217b..2112dc6a81 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -239,7 +239,7 @@ Rectangle { id: readMoreButton anchors.right: parent.right - anchors.bottom: parent.bottom + anchors.bottom: descriptionLabel.bottom height: fontMetrics.height //Height of a single line. text: catalog.i18nc("@info", "Read more") From c6501d6adeb1b155f35eca72626b8d2ed00a397d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:25:50 +0100 Subject: [PATCH 5/7] Use capital letters for busy text It seems though that the wrong text is shown here. In any case this looks more consistent. Contributes to issue CURA-8587. --- plugins/Marketplace/resources/qml/PackageCard.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index 2112dc6a81..7bfee42457 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -324,9 +324,9 @@ Rectangle state: packageData.stateManageEnableButton Layout.alignment: Qt.AlignTop primaryText: catalog.i18nc("@button", "Enable") - busyPrimaryText: catalog.i18nc("@button", "enabling...") + busyPrimaryText: catalog.i18nc("@button", "Inabling...") secondaryText: catalog.i18nc("@button", "Disable") - busySecondaryText: catalog.i18nc("@button", "disabling...") + busySecondaryText: catalog.i18nc("@button", "Disabling...") enabled: !(installManageButton.busy || updateManageButton.busy) onClicked: { @@ -347,9 +347,9 @@ Rectangle state: packageData.stateManageInstallButton Layout.alignment: Qt.AlignTop primaryText: catalog.i18nc("@button", "Install") - busyPrimaryText: catalog.i18nc("@button", "installing...") + busyPrimaryText: catalog.i18nc("@button", "Installing...") secondaryText: catalog.i18nc("@button", "Uninstall") - busySecondaryText: catalog.i18nc("@button", "uninstalling...") + busySecondaryText: catalog.i18nc("@button", "Uninstalling...") enabled: !(enableManageButton.busy || updateManageButton.busy) onClicked: { From c73ef8439505c66a8630820517aa16db224cf9c8 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 6 Dec 2021 16:47:53 +0100 Subject: [PATCH 6/7] Show the correct busy message Contributes to: CURA-8587 --- plugins/Marketplace/resources/qml/ManageButton.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/ManageButton.qml b/plugins/Marketplace/resources/qml/ManageButton.qml index 323fea03f1..5e1aad03e7 100644 --- a/plugins/Marketplace/resources/qml/ManageButton.qml +++ b/plugins/Marketplace/resources/qml/ManageButton.qml @@ -28,6 +28,7 @@ RowLayout onClicked: { + busyMessageText.text = manageButton.busyPrimaryText manageButton.clicked(true) } } @@ -40,6 +41,7 @@ RowLayout onClicked: { + busyMessageText.text = manageButton.busySecondaryText manageButton.clicked(false) } } @@ -76,7 +78,6 @@ RowLayout { id: busyMessageText visible: parent.visible - text: manageButton.state == "primary" ? manageButton.busyPrimaryText : manageButton.busySecondaryText anchors.left: busyIndicator.right anchors.verticalCenter: parent.verticalCenter From f932239b6a0ecdb8a227b02878e8ddc4ff4e4fbe Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Dec 2021 16:52:38 +0100 Subject: [PATCH 7/7] Implement aesthetics of busy indicator Don't use the default spinner but use an image from our theme. A new image. And change the font size, colour and spacings a bit according to our designs. Contributes to issue CURA-8587. --- .../Marketplace/resources/qml/ManageButton.qml | 16 ++++++++++------ .../themes/cura-light/icons/default/Spinner.svg | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 resources/themes/cura-light/icons/default/Spinner.svg diff --git a/plugins/Marketplace/resources/qml/ManageButton.qml b/plugins/Marketplace/resources/qml/ManageButton.qml index 5e1aad03e7..39be04d386 100644 --- a/plugins/Marketplace/resources/qml/ManageButton.qml +++ b/plugins/Marketplace/resources/qml/ManageButton.qml @@ -53,21 +53,24 @@ RowLayout height: UM.Theme.getSize("action_button").height width: childrenRect.width - BusyIndicator + UM.RecolorImage { id: busyIndicator visible: parent.visible width: height anchors.left: parent.left anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("narrow_margin").height anchors.bottom: parent.bottom + anchors.bottomMargin: anchors.topMargin - palette.dark: UM.Theme.getColor("text") + source: UM.Theme.getIcon("Spinner") + color: UM.Theme.getColor("primary") RotationAnimator { - target: busyIndicator.contentItem - running: busyIndicator.visible && busyIndicator.running + target: busyIndicator + running: busyIndicator.visible from: 0 to: 360 loops: Animation.Infinite @@ -79,10 +82,11 @@ RowLayout id: busyMessageText visible: parent.visible anchors.left: busyIndicator.right + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width anchors.verticalCenter: parent.verticalCenter - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") + font: UM.Theme.getFont("medium_bold") + color: UM.Theme.getColor("primary") } } diff --git a/resources/themes/cura-light/icons/default/Spinner.svg b/resources/themes/cura-light/icons/default/Spinner.svg new file mode 100644 index 0000000000..22a8f4dfd9 --- /dev/null +++ b/resources/themes/cura-light/icons/default/Spinner.svg @@ -0,0 +1,3 @@ + + +