mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Set connection status icon + color based on new states
CURA-7437
This commit is contained in:
parent
2eaa366424
commit
de5c6f9318
1 changed files with 21 additions and 20 deletions
|
@ -16,6 +16,25 @@ Cura.ExpandablePopup
|
||||||
property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration
|
property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration
|
||||||
property bool isGroup: Cura.MachineManager.activeMachineIsGroup
|
property bool isGroup: Cura.MachineManager.activeMachineIsGroup
|
||||||
|
|
||||||
|
property string connectionStatus: {
|
||||||
|
if (isNetworkPrinter)
|
||||||
|
{
|
||||||
|
return "printer_connected"
|
||||||
|
}
|
||||||
|
else if (isConnectedCloudPrinter)
|
||||||
|
{
|
||||||
|
return "printer_cloud_connected"
|
||||||
|
}
|
||||||
|
else if (isCloudRegistered)
|
||||||
|
{
|
||||||
|
return "printer_cloud_not_available"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentPadding: UM.Theme.getSize("default_lining").width
|
contentPadding: UM.Theme.getSize("default_lining").width
|
||||||
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
||||||
|
|
||||||
|
@ -68,30 +87,12 @@ Cura.ExpandablePopup
|
||||||
leftMargin: UM.Theme.getSize("thick_margin").width
|
leftMargin: UM.Theme.getSize("thick_margin").width
|
||||||
}
|
}
|
||||||
|
|
||||||
source:
|
source: UM.Theme.getIcon(connectionStatus)
|
||||||
{
|
|
||||||
if (isNetworkPrinter)
|
|
||||||
{
|
|
||||||
return UM.Theme.getIcon("printer_connected")
|
|
||||||
}
|
|
||||||
else if (isConnectedCloudPrinter)
|
|
||||||
{
|
|
||||||
return UM.Theme.getIcon("printer_cloud_connected")
|
|
||||||
}
|
|
||||||
else if (isCloudRegistered)
|
|
||||||
{
|
|
||||||
return UM.Theme.getIcon("printer_cloud_not_available")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
width: UM.Theme.getSize("printer_status_icon").width
|
width: UM.Theme.getSize("printer_status_icon").width
|
||||||
height: UM.Theme.getSize("printer_status_icon").height
|
height: UM.Theme.getSize("printer_status_icon").height
|
||||||
|
|
||||||
color: source == UM.Theme.getIcon("printer_cloud_not_available") ? UM.Theme.getColor("cloud_unavailable") : UM.Theme.getColor("primary")
|
color: connectionStatus == "printer_cloud_not_available" ? UM.Theme.getColor("cloud_unavailable") : UM.Theme.getColor("primary")
|
||||||
|
|
||||||
visible: isNetworkPrinter || isCloudRegistered
|
visible: isNetworkPrinter || isCloudRegistered
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue