keypad: fix calibrate pid not showing sometimes

This commit is contained in:
alfrix 2023-08-03 22:45:09 -03:00
parent 365b9bde4f
commit bd87737467

View File

@ -52,23 +52,21 @@ class Keypad(Gtk.Box):
self.pid = self._gtk.Button('heat-up', _('Calibrate') + ' PID', None, .66, Gtk.PositionType.LEFT, 1)
self.pid.connect("clicked", self.update_entry, "PID")
self.pid.set_sensitive(False)
self.pid.set_no_show_all(True)
b = self._gtk.Button('cancel', _('Close'), None, .66, Gtk.PositionType.LEFT, 1)
b.connect("clicked", close_function)
self.add(self.labels['entry'])
self.add(numpad)
self.bottom = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.bottom.add(self.pid)
self.bottom.add(b)
self.add(self.bottom)
self.labels["keypad"] = numpad
def show_pid(self, can_pid):
if can_pid and self.pid not in self.bottom:
self.bottom.add(self.pid)
self.bottom.reorder_child(self.pid, 0)
elif self.pid in self.bottom:
self.bottom.remove(self.pid)
self.pid.set_visible(can_pid)
def clear(self):
self.labels['entry'].set_text("")