Use ListView instead of Column

The ListView works in mostly the same way, except it loads its contents asynchronously as they come into view.

Contributes to issue CURA-8556.
This commit is contained in:
Ghostkeeper 2021-10-25 16:17:23 +02:00
parent 6b6b6f613f
commit f14a512718
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -10,18 +10,16 @@ ScrollView
{
clip: true
Column
ListView
{
id: pluginColumn
width: parent.width
spacing: UM.Theme.getSize("default_margin").height
Repeater
{
model: Marketplace.PackageList
{
id: pluginList
}
spacing: UM.Theme.getSize("default_margin").height
delegate: Rectangle
{
@ -42,12 +40,17 @@ ScrollView
color: UM.Theme.getColor("text")
}
}
}
footer: Item //Wrapper item to add spacing between content and footer.
{
width: parent.width
height: UM.Theme.getSize("card").height + pluginColumn.spacing
Button
{
id: loadMoreButton
width: parent.width
height: UM.Theme.getSize("card").height
anchors.bottom: parent.bottom
enabled: pluginList.hasMore && !pluginList.isLoading || pluginList.errorMessage != ""
onClicked: pluginList.request() //Load next page in plug-in list.
@ -167,3 +170,4 @@ ScrollView
}
}
}
}