From fe30a3c19e64c2b0f351de6d706557dce540d288 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 30 Dec 2021 12:24:14 +0100 Subject: [PATCH 1/2] Add notification badge for the gear icon in the Market Place CURA 8658 --- .../Marketplace/resources/qml/Marketplace.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 017a9e3dde..27826c15b0 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -159,6 +159,24 @@ Window { property string sourcePage: "ManagedPackages.qml" property bool hasSearch: false + + Cura.NotificationIcon + { + anchors + { + top: parent.top + right: parent.right + rightMargin: (-0.5 * width) | 0 + topMargin: (-0.5 * height) | 0 + } + visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0 + + labelText: + { + const itemCount = CuraApplication.getPackageManager().packagesWithUpdate.length + return itemCount > 9 ? "9+" : itemCount + } + } } } From c92fcc8e037daf291e35a0fe4d0b9d5bf110f9c2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 3 Jan 2022 10:08:17 +0100 Subject: [PATCH 2/2] Simplify the notifaction icon logic CURA-8658 --- plugins/Marketplace/resources/qml/Marketplace.qml | 6 ++---- plugins/PostProcessingPlugin/PostProcessingPlugin.qml | 6 ++---- resources/qml/MainWindow/MainWindowHeader.qml | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 27826c15b0..c04b24cc13 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -164,10 +164,8 @@ Window { anchors { - top: parent.top - right: parent.right - rightMargin: (-0.5 * width) | 0 - topMargin: (-0.5 * height) | 0 + horizontalCenter: parent.right + verticalCenter: parent.top } visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0 diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index bbba2e7621..bd94d1fdfd 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -527,10 +527,8 @@ UM.Dialog visible: activeScriptsList.count > 0 anchors { - top: parent.top - right: parent.right - rightMargin: (-0.5 * width) | 0 - topMargin: (-0.5 * height) | 0 + horizontalCenter: parent.right + verticalCenter: parent.top } labelText: activeScriptsList.count diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index a47f8e963c..cc400252e1 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -174,10 +174,8 @@ Item { anchors { - top: parent.top - right: parent.right - rightMargin: (-0.5 * width) | 0 - topMargin: (-0.5 * height) | 0 + horizontalCenter: parent.right + verticalCenter: parent.top } visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0