ToolboxDownloadsShowcase.qml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. Rectangle
  8. {
  9. color: UM.Theme.getColor("secondary")
  10. height: childrenRect.height
  11. width: parent.width
  12. Column
  13. {
  14. height: childrenRect.height + 2 * padding
  15. spacing: UM.Theme.getSize("toolbox_showcase_spacing").width
  16. width: parent.width
  17. padding: UM.Theme.getSize("wide_margin").height
  18. Label
  19. {
  20. id: heading
  21. text: catalog.i18nc("@label", "Featured")
  22. width: parent.width
  23. color: UM.Theme.getColor("text_medium")
  24. font: UM.Theme.getFont("large")
  25. renderType: Text.NativeRendering
  26. }
  27. Grid
  28. {
  29. height: childrenRect.height
  30. spacing: UM.Theme.getSize("wide_margin").width
  31. columns: 3
  32. anchors.horizontalCenter: parent.horizontalCenter
  33. Repeater
  34. {
  35. model:
  36. {
  37. if (toolbox.viewCategory == "plugin")
  38. {
  39. return toolbox.pluginsShowcaseModel
  40. }
  41. if (toolbox.viewCategory == "material")
  42. {
  43. return toolbox.materialsShowcaseModel
  44. }
  45. }
  46. delegate: Loader
  47. {
  48. asynchronous: true
  49. source: "ToolboxDownloadsShowcaseTile.qml"
  50. }
  51. }
  52. }
  53. }
  54. }