Add disabled state for load more button

Can't click on the button then.

Contributes to issue CURA-8556.
This commit is contained in:
Ghostkeeper 2021-10-21 18:25:33 +02:00
parent 8776294932
commit 46ad1ad077
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -18,7 +18,10 @@ ScrollView
Repeater
{
model: Cura.PackageList{}
model: Cura.PackageList
{
id: pluginList
}
delegate: Rectangle
{
@ -46,6 +49,8 @@ ScrollView
width: parent.width
height: UM.Theme.getSize("card").height
enabled: pluginList.hasMore && !pluginList.isLoading
background: Rectangle
{
anchors.fill: parent
@ -61,19 +66,20 @@ ScrollView
UM.RecolorImage
{
width: UM.Theme.getSize("small_button_icon").width
width: visible ? UM.Theme.getSize("small_button_icon").width : 0
height: UM.Theme.getSize("small_button_icon").height
anchors.verticalCenter: loadMoreLabel.verticalCenter
visible: pluginList.hasMore
source: UM.Theme.getIcon("ArrowDown")
color: UM.Theme.getColor("primary")
color: UM.Theme.getColor(loadMoreButton.enabled ? "secondary_button_text" : "action_button_disabled_text")
}
Label
{
id: loadMoreLabel
text: catalog.i18nc("@button", "Load More")
text: pluginList.hasMore ? catalog.i18nc("@button", "Load More") : catalog.i18nc("@button", "No more results to load")
font: UM.Theme.getFont("medium_bold")
color: UM.Theme.getColor("primary")
color: UM.Theme.getColor(loadMoreButton.enabled ? "secondary_button_text" : "action_button_disabled_text")
}
}
}