ToolboxDetailTile.qml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls.Styles 1.4
  6. import UM 1.1 as UM
  7. Item
  8. {
  9. id: tile
  10. width: detailList.width - UM.Theme.getSize("wide_margin").width
  11. height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height
  12. Item
  13. {
  14. id: normalData
  15. height: childrenRect.height
  16. anchors
  17. {
  18. left: parent.left
  19. right: controls.left
  20. rightMargin: UM.Theme.getSize("default_margin").width * 2 + UM.Theme.getSize("toolbox_loader").width
  21. top: parent.top
  22. }
  23. Label
  24. {
  25. id: packageName
  26. width: parent.width
  27. height: UM.Theme.getSize("toolbox_property_label").height
  28. text: model.name
  29. wrapMode: Text.WordWrap
  30. color: UM.Theme.getColor("text")
  31. font: UM.Theme.getFont("medium_bold")
  32. renderType: Text.NativeRendering
  33. }
  34. Label
  35. {
  36. anchors.top: packageName.bottom
  37. width: parent.width
  38. text: model.description
  39. maximumLineCount: 25
  40. elide: Text.ElideRight
  41. wrapMode: Text.WordWrap
  42. color: UM.Theme.getColor("text")
  43. font: UM.Theme.getFont("default")
  44. renderType: Text.NativeRendering
  45. }
  46. }
  47. ToolboxDetailTileActions
  48. {
  49. id: controls
  50. anchors.right: tile.right
  51. anchors.top: tile.top
  52. width: childrenRect.width
  53. height: childrenRect.height
  54. packageData: model
  55. }
  56. ToolboxCompatibilityChart
  57. {
  58. id: compatibilityChart
  59. anchors.top: normalData.bottom
  60. width: normalData.width
  61. packageData: model
  62. }
  63. Rectangle
  64. {
  65. color: UM.Theme.getColor("lining")
  66. width: tile.width
  67. height: UM.Theme.getSize("default_lining").height
  68. anchors.top: compatibilityChart.bottom
  69. anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
  70. }
  71. }