CURA-5035 Aproaching the asymptote of done

This commit is contained in:
Ian Paschal 2018-04-30 17:05:46 +02:00
parent 01007946b4
commit 2d54251be0
5 changed files with 24 additions and 20 deletions

View file

@ -23,9 +23,7 @@ Item
bottomMargin: UM.Theme.getSize("wide_margin").height
top: parent.top
}
// TODO: Sometimes the height is not the childrenRect.height. Lord
// knows why. Probably because QT is garbage.
height: childrenRect.height
height: childrenRect.height + UM.Theme.getSize("wide_margin").height
spacing: UM.Theme.getSize("default_margin").height
Repeater
{

View file

@ -189,11 +189,12 @@ Item
Item
{
id: supportedConfigsChart
anchors.top: normalData.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
height: model.type == "material" ? childrenRect.height : 0
height: visible ? childrenRect.height : 0
width: normalData.width
visible: model.type == "material"
visible: model.type == "material" && model.supported_configs.length > 0
Label
{
id: compatibilityHeading

View file

@ -41,7 +41,7 @@ class AuthorsModel(ListModel):
"email": author["email"] if "email" in author else None,
"website": author["website"],
"package_count": author["package_count"] if "package_count" in author else 0,
"package_types": author["package_types"],
"package_types": author["package_types"] if "package_types" in author else [],
"icon_url": author["icon_url"] if "icon_url" in author else None,
"description": "Material and quality profiles from {author_name}".format( author_name = author["display_name"])
})

View file

@ -30,6 +30,7 @@ class PackagesModel(ListModel):
self.addRoleName(Qt.UserRole + 11, "download_url")
self.addRoleName(Qt.UserRole + 12, "last_updated")
self.addRoleName(Qt.UserRole + 13, "is_bundled")
self.addRoleName(Qt.UserRole + 14, "supported_configs")
# List of filters for queries. The result is the union of the each list of results.
self._filter = {} # type: Dict[str, str]
@ -55,7 +56,8 @@ class PackagesModel(ListModel):
"image_urls": package["image_urls"] if "image_urls" in package else None,
"download_url": package["download_url"] if "download_url" in package else None,
"last_updated": package["last_updated"] if "last_updated" in package else None,
"is_bundled": package["is_bundled"] if "is_bundled" in package else False
"is_bundled": package["is_bundled"] if "is_bundled" in package else False,
"supported_configs": package["supported_configs"] if "supported_configs" in package else []
})
# Filter on all the key-word arguments.

View file

@ -368,7 +368,10 @@ class Toolbox(QObject, Extension):
# HACK: Eventually get rid of the code from here...
if type is "plugins_showcase" or type is "materials_showcase":
self._metadata["plugins_showcase"] = json_data["data"]["plugin"]["packages"]
self._models["plugins_showcase"].setMetadata(self._metadata["plugins_showcase"])
self._metadata["materials_showcase"] = json_data["data"]["material"]["authors"]
self._models["materials_showcase"].setMetadata(self._metadata["materials_showcase"])
print("MATERIAL SHOWCASE", self._metadata["materials_showcase"])
else:
# ...until here.
# This hack arises for multiple reasons but the main