[pitivi] timeline: Connect button press/release to the timeline, not the whole stage



commit 4dde28b0753eff4548de51565721c1af6fe34d85
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Tue Sep 10 22:16:44 2013 -0400

    timeline: Connect button press/release to the timeline, not the whole stage
    
    Signal handling is then more specific, preventing useless (and wrong) stuff
    from happening when clicking layer controls instead of the timeline canvas.
    This is in preparation for making focus-based timeline actions sensitivity work.

 pitivi/timeline/timeline.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index e49b03b..66f078e 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -867,8 +867,8 @@ class Timeline(Gtk.VBox, Zoomable, Loggable):
         self.stage.add_child(self.controls)
         self.stage.add_child(self.timeline)
 
-        self.stage.connect("button-press-event", self._clickedCb)
-        self.stage.connect("button-release-event", self._releasedCb)
+        self.timeline.connect("button-press-event", self._timelineClickedCb)
+        self.timeline.connect("button-release-event", self._timelineClickReleasedCb)
         self.embed.connect("scroll-event", self._scrollEventCb)
 
         if self.gui:
@@ -1311,13 +1311,13 @@ class Timeline(Gtk.VBox, Zoomable, Loggable):
         elif event.keyval == Gdk.KEY_Control_L:
             self.controlMask = False
 
-    def _clickedCb(self, stage, event):
+    def _timelineClickedCb(self, unused_timeline, event):
         self.pressed = True
         position = self.pixelToNs(event.x - CONTROL_WIDTH + self.timeline._scroll_point.x)
         if self.app:
             self._seeker.seek(position)
 
-    def _releasedCb(self, stage, event):
+    def _timelineClickReleasedCb(self, unused_timeline, unused_event):
         self.timeline._snapEndedCb()
 
     def _renderingSettingsChangedCb(self, project, item, value):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]