mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-01 06:41:06 -07:00
Add spinners and status icons per printer
These make use of the per-printer sync status to show either nothing, a spinner, a cross or a checkmark. Contributes to issue CURA-8609.
This commit is contained in:
parent
2b6a82ecf1
commit
bfb39cf989
1 changed files with 46 additions and 1 deletions
|
|
@ -258,11 +258,22 @@ Window
|
||||||
model: cloudPrinterList
|
model: cloudPrinterList
|
||||||
delegate: Rectangle
|
delegate: Rectangle
|
||||||
{
|
{
|
||||||
|
id: delegateContainer
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
width: printerListScrollView.width
|
width: printerListScrollView.width
|
||||||
height: UM.Theme.getSize("card").height
|
height: UM.Theme.getSize("card").height
|
||||||
|
|
||||||
|
property string syncStatus:
|
||||||
|
{
|
||||||
|
var printer_id = model.metadata["host_guid"]
|
||||||
|
if(syncModel.printerStatus[printer_id] === undefined) //No status information available. Could be added after we started syncing.
|
||||||
|
{
|
||||||
|
return "idle";
|
||||||
|
}
|
||||||
|
return syncModel.printerStatus[printer_id];
|
||||||
|
}
|
||||||
|
|
||||||
Cura.IconWithText
|
Cura.IconWithText
|
||||||
{
|
{
|
||||||
anchors
|
anchors
|
||||||
|
|
@ -309,6 +320,40 @@ Window
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.RecolorImage
|
||||||
|
{
|
||||||
|
width: UM.Theme.getSize("section_icon").width
|
||||||
|
height: width
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
|
||||||
|
|
||||||
|
visible: delegateContainer.syncStatus === "uploading"
|
||||||
|
source: UM.Theme.getIcon("ArrowDoubleCircleRight")
|
||||||
|
color: UM.Theme.getColor("primary")
|
||||||
|
|
||||||
|
RotationAnimator
|
||||||
|
{
|
||||||
|
target: printerStatusSyncingIcon
|
||||||
|
from: 0
|
||||||
|
to: 360
|
||||||
|
duration: 1000
|
||||||
|
loops: Animation.Infinite
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UM.StatusIcon
|
||||||
|
{
|
||||||
|
width: UM.Theme.getSize("section_icon").width
|
||||||
|
height: width
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
|
||||||
|
|
||||||
|
visible: delegateContainer.syncStatus === "failed" || delegateContainer.syncStatus === "success"
|
||||||
|
status: delegateContainer.syncStatus === "success" ? UM.StatusIcon.Status.POSITIVE : UM.StatusIcon.Status.ERROR
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: Item
|
footer: Item
|
||||||
|
|
@ -431,7 +476,7 @@ Window
|
||||||
to: 360
|
to: 360
|
||||||
duration: 1000
|
duration: 1000
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
running: !syncButton.visible //Don't run while invisible. Would be a waste of render updates.
|
running: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue