job_status: fix layout break due to too long temps

having 3 heaters with power enabled is too long and breaks the interface, return to no extra digit in the job-status page
This commit is contained in:
Alfredo Monclus 2024-05-27 23:19:12 -03:00
parent bb8031ce89
commit 7d6260d3ed
2 changed files with 3 additions and 2 deletions

View File

@ -184,8 +184,8 @@ class ScreenPanel:
name = name.title()
return name
def update_temp(self, dev, temp, target, power, lines=1):
new_label_text = f"{temp or 0:.1f}"
def update_temp(self, dev, temp, target, power, lines=1, digits=1):
new_label_text = f"{temp or 0:.{digits}f}"
if self._printer.device_has_target(dev) and target:
new_label_text += f"/{target:.0f}"
if dev not in self.devices:

View File

@ -481,6 +481,7 @@ class Panel(ScreenPanel):
self._printer.get_stat(x, "temperature"),
self._printer.get_stat(x, "target"),
self._printer.get_stat(x, "power"),
digits=0
)
if x in self.buttons['extruder']:
self.buttons['extruder'][x].set_label(self.labels[x].get_text())