mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 04:25:56 +08:00
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:
parent
6b6b6f613f
commit
f14a512718
@ -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.
|
||||
@ -166,4 +169,5 @@ ScrollView
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user