style(job_status): if there is no lcd_message center the filename

This commit is contained in:
Alfredo Monclus committed 2024-06-24 21:47:35 -03:00
1 parent cd0b519833
commit 733cda93ea
2 files changed
+9 -7

No files matched your search

+7 -5
View File
@@ -82,14 +82,14 @@ class Panel(ScreenPanel):
self.labels['file'] = Gtk.Label(label="Filename", hexpand=True)
self.labels['file'].get_style_context().add_class("printing-filename")
self.labels['lcdmessage'] = Gtk.Label()
self.labels['lcdmessage'] = Gtk.Label(no_show_all=True)
self.labels['lcdmessage'].get_style_context().add_class("printing-status")
for label in self.labels:
self.labels[label].set_halign(Gtk.Align.START)
self.labels[label].set_ellipsize(Pango.EllipsizeMode.END)
fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10, valign=Gtk.Align.CENTER)
fi_box.add(self.labels['file'])
fi_box.add(self.labels['lcdmessage'])
self.grid.attach(fi_box, 1, 0, 3, 1)
@@ -485,9 +485,11 @@ class Panel(ScreenPanel):
self.buttons['heater'][x].set_label(self.labels[x].get_text())
if "display_status" in data and "message" in data["display_status"]:
self.labels['lcdmessage'].set_label(
f"{data['display_status']['message'] if data['display_status']['message'] is not None else ''}"
)
if data['display_status']['message']:
self.labels['lcdmessage'].set_label(f"{data['display_status']['message']}")
self.labels['lcdmessage'].show()
else:
self.labels['lcdmessage'].hide()
if 'toolhead' in data:
if 'extruder' in data['toolhead'] and data['toolhead']['extruder'] != self.current_extruder:
+2 -2
View File
@@ -480,7 +480,7 @@ trough {
.printing-filename {
font-size: 1.4em;
font-weight: bold;
margin: .25em .25em 0 0;
margin-right: .25em;
}
.printing-info {
@@ -498,7 +498,7 @@ trough {
.printing-status {
font-style: italic;
margin: 0;
margin-right: .25em;
font-weight: bold;
}