heatergraph: clean press callback and connect to screensaver

This commit is contained in:
alfrix 2024-05-03 13:48:44 -03:00
parent 4c72ade658
commit 4b9295de76

View File

@ -22,7 +22,7 @@ class HeaterGraph(Gtk.DrawingArea):
self.connect('draw', self.draw_graph)
self.add_events(Gdk.EventMask.TOUCH_MASK)
self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.connect('touch-event', self.event_cb)
self.connect('button_press_event', screen.reset_screensaver_timeout)
self.connect('button_press_event', self.event_cb)
self.font_size = round(font_size * 0.75)
self.fullscreen = fullscreen
@ -44,12 +44,11 @@ class HeaterGraph(Gtk.DrawingArea):
self._gtk.remove_dialog(dialog)
def event_cb(self, da, ev):
if ev.type == Gdk.EventType.BUTTON_PRESS:
if self.fullscreen:
logging.info(f"Graph area: {ev.x} {ev.y}")
else:
self.show_fullscreen_graph()
logging.info("Entering Fullscreen")
if self.fullscreen:
logging.info(f"Graph area: {ev.x} {ev.y}")
else:
self.show_fullscreen_graph()
logging.info("Entering Fullscreen")
def add_object(self, name, ev_type, rgb=None, dashed=False, fill=False):
rgb = [0, 0, 0] if rgb is None else rgb