main and temp: fix gtk warning

This commit is contained in:
alfrix committed 2022-11-24 14:57:36 -03:00
1 parent 43a2f88ad1
commit e1f02fd870
2 files changed
+6 -5

No files matched your search

+3 -2
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:
self.left_panel.add(self.labels['da'])
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):
+3 -3
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:
self.left_panel.add(self.labels['da'])
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)