ToolboxDownloadsShowcase.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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("default_margin").height
  16. width: parent.width
  17. padding: UM.Theme.getSize("wide_margin").height
  18. Item
  19. {
  20. width: parent.width - parent.padding * 2
  21. height: childrenRect.height
  22. Label
  23. {
  24. id: heading
  25. text: catalog.i18nc("@label", "Featured")
  26. width: contentWidth
  27. height: contentHeight
  28. color: UM.Theme.getColor("text_medium")
  29. font: UM.Theme.getFont("large")
  30. renderType: Text.NativeRendering
  31. }
  32. UM.TooltipArea
  33. {
  34. width: childrenRect.width
  35. height: childrenRect.height
  36. anchors.right: parent.right
  37. text: catalog.i18nc("@info:tooltip", "Go to Web Marketplace")
  38. Label
  39. {
  40. text: "<a href='%2'>".arg(toolbox.getWebMarketplaceUrl("materials")) + catalog.i18nc("@label", "Search materials") + "</a>"
  41. width: contentWidth
  42. height: contentHeight
  43. horizontalAlignment: Text.AlignRight
  44. font: UM.Theme.getFont("default")
  45. renderType: Text.NativeRendering
  46. linkColor: UM.Theme.getColor("text_link")
  47. onLinkActivated: Qt.openUrlExternally(link)
  48. visible: toolbox.viewCategory === "material"
  49. }
  50. }
  51. }
  52. Grid
  53. {
  54. height: childrenRect.height
  55. spacing: UM.Theme.getSize("wide_margin").width
  56. columns: 3
  57. anchors.horizontalCenter: parent.horizontalCenter
  58. Repeater
  59. {
  60. model:
  61. {
  62. if (toolbox.viewCategory == "plugin")
  63. {
  64. return toolbox.pluginsShowcaseModel
  65. }
  66. if (toolbox.viewCategory == "material")
  67. {
  68. return toolbox.materialsShowcaseModel
  69. }
  70. }
  71. delegate: Loader
  72. {
  73. asynchronous: true
  74. source: "ToolboxDownloadsShowcaseTile.qml"
  75. }
  76. }
  77. }
  78. }
  79. }