VerifiedIcon.qml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2022 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.15
  4. import QtQuick.Controls 2.15
  5. import QtQuick.Layouts 1.1
  6. import UM 1.6 as UM
  7. import Cura 1.6 as Cura
  8. Control
  9. {
  10. implicitWidth: UM.Theme.getSize("card_tiny_icon").width
  11. implicitHeight: UM.Theme.getSize("card_tiny_icon").height
  12. UM.ToolTip
  13. {
  14. tooltipText:
  15. {
  16. switch(packageData.packageType)
  17. {
  18. case "plugin": return catalog.i18nc("@info", "UltiMaker Verified Plug-in");
  19. case "material": return catalog.i18nc("@info", "UltiMaker Certified Material");
  20. default: return catalog.i18nc("@info", "UltiMaker Verified Package");
  21. }
  22. }
  23. visible: parent.hovered
  24. targetPoint: Qt.point(0, Math.round(parent.y + parent.height / 4))
  25. }
  26. Rectangle
  27. {
  28. anchors.fill: parent
  29. color: UM.Theme.getColor("action_button_hovered")
  30. radius: width
  31. UM.ColorImage
  32. {
  33. anchors.fill: parent
  34. color: UM.Theme.getColor("primary")
  35. source: packageData.packageType == "plugin" ? UM.Theme.getIcon("CheckCircle") : UM.Theme.getIcon("Certified")
  36. }
  37. }
  38. //NOTE: Can we link to something here? (Probably a static link explaining what verified is):
  39. // onClicked: Qt.openUrlExternally( XXXXXX )
  40. }