Marketplace.qml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // Copyright (c) 2021 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.15
  4. import QtQuick.Controls 2.15
  5. import QtQuick.Layouts 1.15
  6. import QtQuick.Window 2.2
  7. import UM 1.2 as UM
  8. Window
  9. {
  10. id: marketplaceDialog
  11. property variant catalog: UM.I18nCatalog { name: "cura" }
  12. minimumWidth: UM.Theme.getSize("modal_window_minimum").width
  13. minimumHeight: UM.Theme.getSize("modal_window_minimum").height
  14. width: minimumWidth
  15. height: minimumHeight
  16. onVisibleChanged:
  17. {
  18. // Set and unset the content. No need to keep things in memory if it's not visible.
  19. if(visible)
  20. {
  21. content.source = "plugins.qml"
  22. }
  23. else
  24. {
  25. content.source = ""
  26. }
  27. }
  28. title: "Marketplace" //Seen by Ultimaker as a brand name, so this doesn't get translated.
  29. modality: Qt.NonModal
  30. Rectangle //Background color.
  31. {
  32. anchors.fill: parent
  33. color: UM.Theme.getColor("main_background")
  34. ColumnLayout
  35. {
  36. anchors.fill: parent
  37. spacing: UM.Theme.getSize("default_margin").height
  38. Item //Page title.
  39. {
  40. Layout.preferredWidth: parent.width
  41. Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
  42. Label
  43. {
  44. anchors
  45. {
  46. left: parent.left
  47. leftMargin: UM.Theme.getSize("default_margin").width
  48. right: parent.right
  49. rightMargin: UM.Theme.getSize("default_margin").width
  50. bottom: parent.bottom
  51. }
  52. font: UM.Theme.getFont("large")
  53. color: UM.Theme.getColor("text")
  54. text: catalog.i18nc("@header", "Install Plugins")
  55. }
  56. }
  57. Rectangle //Page contents.
  58. {
  59. Layout.preferredWidth: parent.width
  60. Layout.fillHeight: true
  61. color: UM.Theme.getColor("detail_background")
  62. Loader //Page contents.
  63. {
  64. id: content
  65. anchors.fill: parent
  66. anchors.margins: UM.Theme.getSize("default_margin").width
  67. source: "Plugins.qml"
  68. }
  69. }
  70. }
  71. }
  72. }