PackageCard.qml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. PackageCardHeader
  18. {
  19. id: packageCardHeader
  20. Item
  21. {
  22. id: shortDescription
  23. anchors.fill: parent
  24. UM.Label
  25. {
  26. id: descriptionLabel
  27. width: parent.width
  28. text: packageData.description
  29. maximumLineCount: 2
  30. elide: Text.ElideRight
  31. visible: text !== ""
  32. }
  33. }
  34. }
  35. FontMetrics
  36. {
  37. id: fontMetrics
  38. font: UM.Theme.getFont("default")
  39. }
  40. }