Marketplace.qml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. import Cura 1.6 as Cura
  9. Window
  10. {
  11. id: marketplaceDialog
  12. property variant catalog: UM.I18nCatalog { name: "cura" }
  13. minimumWidth: UM.Theme.getSize("modal_window_minimum").width
  14. minimumHeight: UM.Theme.getSize("modal_window_minimum").height
  15. width: minimumWidth
  16. height: minimumHeight
  17. // Set and unset the content. No need to keep things in memory if it's not visible.
  18. onVisibleChanged: content.source = visible ? "Plugins.qml" : ""
  19. Connections
  20. {
  21. target: Cura.API.account
  22. function onLoginStateChanged()
  23. {
  24. close();
  25. }
  26. }
  27. title: "Marketplace" //Seen by Ultimaker as a brand name, so this doesn't get translated.
  28. modality: Qt.NonModal
  29. Rectangle //Background color.
  30. {
  31. anchors.fill: parent
  32. color: UM.Theme.getColor("main_background")
  33. ColumnLayout
  34. {
  35. anchors.fill: parent
  36. spacing: UM.Theme.getSize("default_margin").height
  37. Item //Page title.
  38. {
  39. Layout.preferredWidth: parent.width
  40. Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
  41. Label
  42. {
  43. anchors
  44. {
  45. left: parent.left
  46. leftMargin: UM.Theme.getSize("default_margin").width
  47. right: parent.right
  48. rightMargin: UM.Theme.getSize("default_margin").width
  49. bottom: parent.bottom
  50. }
  51. font: UM.Theme.getFont("large")
  52. color: UM.Theme.getColor("text")
  53. text: catalog.i18nc("@header", "Install Plugins")
  54. }
  55. }
  56. Rectangle //Page contents.
  57. {
  58. Layout.preferredWidth: parent.width
  59. Layout.fillHeight: true
  60. color: UM.Theme.getColor("detail_background")
  61. Loader //Page contents.
  62. {
  63. id: content
  64. anchors.fill: parent
  65. anchors.margins: UM.Theme.getSize("default_margin").width
  66. source: "Plugins.qml"
  67. }
  68. }
  69. }
  70. }
  71. }