From bddcf3cb0cefd8caa0cff5451114d22f90d1cac4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 22 Nov 2021 17:16:39 +0100 Subject: [PATCH] Add extensible switch case for tooltip This way it's - more clear what the two cases are - and more robust if we ever add a third. Contributes to issue CURA-8562. --- plugins/Marketplace/resources/qml/PackageCard.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index 64aedc4c4a..433b77a54d 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -90,7 +90,15 @@ Rectangle Cura.ToolTip { - tooltipText: packageData.packageType == "plugin" ? catalog.i18nc("@info", "Ultimaker Verified Plugin") : catalog.i18nc("@info", "Ultimaker Certified Material") + tooltipText: + { + switch(packageData.packageType) + { + case "plugin": return catalog.i18nc("@info", "Ultimaker Verified Plug-in"); + case "material": return catalog.i18nc("@info", "Ultimaker Certified Material"); + default: return catalog.i18nc("@info", "Ultimaker Verified Package"); + } + } visible: parent.hovered targetPoint: Qt.point(0, Math.round(parent.y + parent.height / 2)) }