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.
This commit is contained in:
Ghostkeeper 2021-11-22 17:16:39 +01:00
parent 35ba8f78a0
commit bddcf3cb0c
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -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))
}