PackageCard.qml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (c) 2021 Ultimaker B.V.
  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. Rectangle
  9. {
  10. property alias packageData: packageCardHeader.packageData
  11. property alias showUpdateButton: packageCardHeader.showUpdateButton
  12. property alias showDisableButton: packageCardHeader.showDisableButton
  13. property alias showInstallButton: packageCardHeader.showInstallButton
  14. height: childrenRect.height
  15. color: UM.Theme.getColor("main_background")
  16. radius: UM.Theme.getSize("default_radius").width
  17. border.color: packageData.isMissingPackageInformation ? UM.Theme.getColor("warning") : "transparent"
  18. border.width: packageData.isMissingPackageInformation ? UM.Theme.getSize("default_lining").width : 0
  19. PackageCardHeader
  20. {
  21. id: packageCardHeader
  22. Item
  23. {
  24. id: shortDescription
  25. anchors.fill: parent
  26. UM.Label
  27. {
  28. id: descriptionLabel
  29. width: parent.width
  30. text: packageData.description
  31. maximumLineCount: 2
  32. elide: Text.ElideRight
  33. visible: text !== ""
  34. }
  35. }
  36. }
  37. FontMetrics
  38. {
  39. id: fontMetrics
  40. font: UM.Theme.getFont("default")
  41. }
  42. }