ToolboxDownloadsGrid.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 2.3
  5. import UM 1.1 as UM
  6. Column
  7. {
  8. property var heading: ""
  9. property var model
  10. id: gridArea
  11. height: childrenRect.height + 2 * padding
  12. width: parent.width
  13. spacing: UM.Theme.getSize("default_margin").height
  14. padding: UM.Theme.getSize("wide_margin").height
  15. Label
  16. {
  17. id: heading
  18. text: gridArea.heading
  19. width: parent.width
  20. color: UM.Theme.getColor("text_medium")
  21. font: UM.Theme.getFont("large")
  22. renderType: Text.NativeRendering
  23. }
  24. Grid
  25. {
  26. id: grid
  27. width: parent.width - 2 * parent.padding
  28. columns: 2
  29. columnSpacing: UM.Theme.getSize("default_margin").height
  30. rowSpacing: UM.Theme.getSize("default_margin").width
  31. Repeater
  32. {
  33. model: gridArea.model
  34. delegate: Loader
  35. {
  36. asynchronous: true
  37. width: Math.round((grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns)
  38. height: UM.Theme.getSize("toolbox_thumbnail_small").height
  39. source: "ToolboxDownloadsGridTile.qml"
  40. }
  41. }
  42. }
  43. }