diff --git a/MyTimeline.py b/MyTimeline.py index cfa2033..cc67abe 100644 --- a/MyTimeline.py +++ b/MyTimeline.py @@ -89,6 +89,15 @@ CLICKABLE_AREA_HEIGHT = 30 YEAR_LABEL_WIDTH = 100 YEAR_MARKER_STEP_DIVISOR = 10 # Divisor for calculating year marker step (every Nth year) TOOLTIP_DELAY = 500 # milliseconds + +# Drawing Area Event Masks +DRAWING_AREA_EVENT_MASKS = ( + Gdk.EventMask.BUTTON_PRESS_MASK + | Gdk.EventMask.BUTTON_RELEASE_MASK + | Gdk.EventMask.POINTER_MOTION_MASK + | Gdk.EventMask.LEAVE_NOTIFY_MASK + | Gdk.EventMask.SCROLL_MASK +) TOOLTIP_MAX_WIDTH = 500 LABEL_BACKGROUND_PADDING = 8 LABEL_BACKGROUND_RADIUS = 5 @@ -644,13 +653,7 @@ class MyTimelineView(NavigationView): self.drawing_area = Gtk.DrawingArea() self.drawing_area.set_size_request(800, 600) self.drawing_area.connect("draw", self.on_draw) - self.drawing_area.add_events( - Gdk.EventMask.BUTTON_PRESS_MASK - | Gdk.EventMask.BUTTON_RELEASE_MASK - | Gdk.EventMask.POINTER_MOTION_MASK - | Gdk.EventMask.LEAVE_NOTIFY_MASK - | Gdk.EventMask.SCROLL_MASK - ) + self.drawing_area.add_events(DRAWING_AREA_EVENT_MASKS) # Connect mouse events self.drawing_area.connect("button-press-event", self.on_button_press)