main and temp: fix gtk warning

This commit is contained in:
alfrix 2022-11-24 14:57:25 -03:00
parent 43a2f88ad1
commit e1f02fd870
2 changed files with 6 additions and 5 deletions

View File

@ -66,10 +66,11 @@ class MainPanel(MenuPanel):
self.devices[device]['name'].get_style_context().add_class("graph_label_hidden")
self.devices[device]['name'].get_style_context().remove_class(self.devices[device]['class'])
if count > 0:
if self.labels['da'] not in self.left_panel:
self.left_panel.add(self.labels['da'])
self.labels['da'].queue_draw()
self.labels['da'].show()
else:
elif self.labels['da'] in self.left_panel:
self.left_panel.remove(self.labels['da'])
def activate(self):

View File

@ -189,10 +189,11 @@ class TemperaturePanel(ScreenPanel):
self.devices[device]['name'].get_style_context().add_class("graph_label_hidden")
self.devices[device]['name'].get_style_context().remove_class(self.devices[device]['class'])
if count > 0:
if self.labels['da'] not in self.left_panel:
self.left_panel.add(self.labels['da'])
self.labels['da'].queue_draw()
self.labels['da'].show()
else:
elif self.labels['da'] in self.left_panel:
self.left_panel.remove(self.labels['da'])
def activate(self):
@ -439,7 +440,6 @@ class TemperaturePanel(ScreenPanel):
self.left_panel = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
self.left_panel.add(scroll)
self.left_panel.add(self.labels['da'])
self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp"))
self.labels['graph_settemp'].connect("clicked", self.show_numpad)