Browse Source

Apply suggestions from code review

Applied code review comments

Co-authored-by: Jaime van Kessel <nallath@gmail.com>

Jelle Spijker 3 years ago
parent
commit
3a94fc0ced

+ 1 - 2
plugins/Marketplace/LocalPackageList.py

@@ -18,7 +18,6 @@ catalog = i18nCatalog("cura")
 
 
 class LocalPackageList(PackageList):
-    PackageRole = Qt.UserRole + 1
     PACKAGE_SECTION_HEADER = {
         "installed":
             {
@@ -46,7 +45,7 @@ class LocalPackageList(PackageList):
         self.setErrorMessage("")  # Clear any previous errors.
         self.setIsLoading(True)
         self._getLocalPackages()
-        self.setIsLoading(True)
+        self.setIsLoading(False)
 
     def _getLocalPackages(self) -> None:
         """ Obtain the local packages.

+ 1 - 1
plugins/Marketplace/PackageList.py

@@ -42,7 +42,7 @@ class PackageList(ListModel):
         """ Resets and clears the list"""
         self.clear()
 
-    isLoadingChanged = pyqtSignal()  # The signal for isLoading property
+    isLoadingChanged = pyqtSignal() 
 
     def setIsLoading(self, value: bool) -> None:
         if self._is_loading != value:

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

@@ -66,7 +66,7 @@ Window
 
                     font: UM.Theme.getFont("large")
                     color: UM.Theme.getColor("text")
-                    text: ""
+                    text: content.item ? content.item.pageTitle: catalog.i18nc("@title", "Loading...")
                 }
             }
 

+ 1 - 2
plugins/Marketplace/resources/qml/Packages.qml

@@ -25,11 +25,10 @@ ScrollView
         spacing: UM.Theme.getSize("default_margin").height
 
         section.property: "package.sectionTitle"
-        section.criteria: ViewSection.FullString
         section.delegate: Rectangle
         {
             width: packagesListview.width
-            height: sectionHeaderText.implicitHeight + UM.Theme.getSize("default_margin").height
+            height: sectionHeaderText.height + UM.Theme.getSize("default_margin").height
 
             color: UM.Theme.getColor("detail_background")