Make countdown visibility dependent on its own text

No need to 'update' that in the update timer. We can just link it and it updates on its own.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-16 11:03:37 +01:00
parent d363736fdd
commit 9a5b355f2b
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75

View File

@ -291,12 +291,10 @@ Column
preheatCountdown.text = ""
if (connectedPrinter != null)
{
preheatCountdown.visible = true;
preheatCountdown.text = connectedPrinter.preheatBedRemainingTime;
}
if (preheatCountdown.text == "") //Either time elapsed or not connected.
{
preheatCountdown.visible = false;
stop();
}
}
@ -304,8 +302,8 @@ Column
Label
{
id: preheatCountdown
text: "0:00"
visible: false //It only becomes visible when the timer is running.
text: ""
visible: text != "" //Has no direct effect, but just so that we can link visibility of clock icon to visibility of the countdown text.
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.right: preheatButton.left