mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-17 18:35:54 +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
|
clip: true
|
||||||
|
|
||||||
Column
|
ListView
|
||||||
{
|
{
|
||||||
id: pluginColumn
|
id: pluginColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
|
||||||
|
|
||||||
Repeater
|
|
||||||
{
|
|
||||||
model: Marketplace.PackageList
|
model: Marketplace.PackageList
|
||||||
{
|
{
|
||||||
id: pluginList
|
id: pluginList
|
||||||
}
|
}
|
||||||
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
delegate: Rectangle
|
delegate: Rectangle
|
||||||
{
|
{
|
||||||
@ -42,12 +40,17 @@ ScrollView
|
|||||||
color: UM.Theme.getColor("text")
|
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
|
Button
|
||||||
{
|
{
|
||||||
id: loadMoreButton
|
id: loadMoreButton
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: UM.Theme.getSize("card").height
|
height: UM.Theme.getSize("card").height
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
enabled: pluginList.hasMore && !pluginList.isLoading || pluginList.errorMessage != ""
|
enabled: pluginList.hasMore && !pluginList.isLoading || pluginList.errorMessage != ""
|
||||||
onClicked: pluginList.request() //Load next page in plug-in list.
|
onClicked: pluginList.request() //Load next page in plug-in list.
|
||||||
@ -166,4 +169,5 @@ ScrollView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user