Browse Source

Clear contents of net marketplace if window is closed

CURA-8556
Jaime van Kessel 3 years ago
parent
commit
7bbc91b7a5
1 changed files with 13 additions and 1 deletions
  1. 13 1
      plugins/Marketplace/resources/qml/Marketplace.qml

+ 13 - 1
plugins/Marketplace/resources/qml/Marketplace.qml

@@ -18,6 +18,18 @@ Window
     width: minimumWidth
     height: minimumHeight
 
+    onVisibleChanged:
+    {
+        // Set and unset the content. No need to keep things in memory if it's not visible. 
+        if(visible)
+        {
+            content.source = "plugins.qml"
+        }
+        else
+        {
+            content.source = ""
+        }
+    }
     title: "Marketplace" //Seen by Ultimaker as a brand name, so this doesn't get translated.
     modality: Qt.NonModal
 
@@ -61,9 +73,9 @@ Window
 
                 Loader //Page contents.
                 {
+                    id: content
                     anchors.fill: parent
                     anchors.margins: UM.Theme.getSize("default_margin").width
-
                     source: "Plugins.qml"
                 }
             }