ToolboxDetailTile.qml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  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. }
  33. Label
  34. {
  35. anchors.top: packageName.bottom
  36. width: parent.width
  37. text: model.description
  38. maximumLineCount: 3
  39. elide: Text.ElideRight
  40. wrapMode: Text.WordWrap
  41. color: UM.Theme.getColor("text")
  42. font: UM.Theme.getFont("default")
  43. }
  44. }
  45. ToolboxDetailTileActions
  46. {
  47. id: controls
  48. anchors.right: tile.right
  49. anchors.top: tile.top
  50. width: childrenRect.width
  51. height: childrenRect.height
  52. }
  53. ToolboxCompatibilityChart
  54. {
  55. id: compatibilityChart
  56. anchors.top: normalData.bottom
  57. width: normalData.width
  58. packageData: model
  59. }
  60. Rectangle
  61. {
  62. color: UM.Theme.getColor("lining")
  63. width: tile.width
  64. height: UM.Theme.getSize("default_lining").height
  65. anchors.top: compatibilityChart.bottom
  66. anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
  67. }
  68. }