temperature: fix pre-selection close #1377

This commit is contained in:
Alfredo Monclus 2024-05-26 08:21:23 -03:00
parent 6815e9cabc
commit 954042691d

View File

@ -25,15 +25,21 @@ class Panel(ScreenPanel):
self.h = self.f = 0
self.tempdeltas = ["1", "5", "10", "25"]
self.tempdelta = self.tempdeltas[-2]
self.show_preheat = False
self.show_preheat = self._printer.state in ("printing", "paused")
self.preheat_options = self._screen._config.get_preheat_options()
self.grid = Gtk.Grid(row_homogeneous=True, column_homogeneous=True)
self._gtk.reset_temp_color()
# When printing start in temp_delta mode and only select tools
if self._screen.vertical_mode:
self.grid.attach(self.create_left_panel(), 0, 0, 1, 3)
self.grid.attach(self.create_right_panel(), 0, 3, 1, 2)
else:
self.grid.attach(self.create_left_panel(), 0, 0, 1, 1)
self.grid.attach(self.create_right_panel(), 1, 0, 1, 1)
# When printing start only select tools
selection = []
if self._printer.state not in ("printing", "paused"):
self.show_preheat = True
selection.extend(self._printer.get_temp_devices())
elif extra:
selection.append(extra)
@ -49,13 +55,6 @@ class Panel(ScreenPanel):
if h not in self.active_heaters:
self.select_heater(None, h)
if self._screen.vertical_mode:
self.grid.attach(self.create_left_panel(), 0, 0, 1, 3)
self.grid.attach(self.create_right_panel(), 0, 3, 1, 2)
else:
self.grid.attach(self.create_left_panel(), 0, 0, 1, 1)
self.grid.attach(self.create_right_panel(), 1, 0, 1, 1)
self.content.add(self.grid)
def create_right_panel(self):