From 83c6f87281e6c012caeb53cbf3e4f761dda797bb Mon Sep 17 00:00:00 2001 From: alfrix Date: Tue, 2 Aug 2022 09:31:48 -0300 Subject: [PATCH] temperature: fix blank space if the special cooldown is not at the bottom of the config #688 --- panels/temperature.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panels/temperature.py b/panels/temperature.py index aef87e33..9a466a74 100644 --- a/panels/temperature.py +++ b/panels/temperature.py @@ -92,11 +92,13 @@ class TemperaturePanel(ScreenPanel): def preheat(self): self.labels["preheat_grid"] = self._gtk.HomogeneousGrid() - for i, option in enumerate(self.preheat_options): + i = 0 + for option in self.preheat_options: if option != "cooldown": self.labels[option] = self._gtk.Button(option, f"color{(i % 4) + 1}") self.labels[option].connect("clicked", self.set_temperature, option) self.labels['preheat_grid'].attach(self.labels[option], (i % 2), int(i / 2), 1, 1) + i += 1 scroll = Gtk.ScrolledWindow() scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scroll.add(self.labels["preheat_grid"])