Hide refresh button if there are no offline printers

It's not considered a big use case when the user has already added some printers but would want to add more while syncing materials to those printers.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-11 14:11:28 +02:00
parent 9ffbaa772f
commit 56eb694745
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -266,7 +266,8 @@ Window
footer: Item
{
width: printerListScrollView.width
height: UM.Theme.getSize("card").height + UM.Theme.getSize("default_margin").height
height: visible ? UM.Theme.getSize("card").height + UM.Theme.getSize("default_margin").height : 0
visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0
Rectangle
{
border.color: UM.Theme.getColor("lining")
@ -533,6 +534,13 @@ Window
filterConnectionType: 3 //Only show cloud connections.
filterOnlineOnly: true //Only show printers that are online.
}
Cura.GlobalStacksModel
{
//In order to show a refresh button only when there are offline cloud printers, we need to know if there are any offline printers.
//A global stacks model without the filter for online-only printers allows this.
id: includeOfflinePrinterList
filterConnectionType: 3 //Still only show cloud connections.
}
FileDialog
{