[pitivi] timeline: Clarify why Timeline.got_dragged exists
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] timeline: Clarify why Timeline.got_dragged exists
- Date: Wed, 16 Sep 2015 15:50:12 +0000 (UTC)
commit 27b9150491fe7f3c54caaec74aad03789b6d7623
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Fri Jul 10 22:55:16 2015 +0200
timeline: Clarify why Timeline.got_dragged exists
Summary: Depends on D257
Reviewers: Mathieu_Du, aleb
Differential Revision: https://phabricator.freedesktop.org/D258
pitivi/timeline/elements.py | 13 +++++--------
pitivi/timeline/timeline.py | 2 ++
2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 5ebce0e..91404f5 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -676,7 +676,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
def sendFakeEvent(self, event, event_widget):
if event.type == Gdk.EventType.BUTTON_RELEASE:
- self._clickedCb(event_widget, event)
+ self.__buttonReleaseEventCb(event_widget, event)
self.timeline.sendFakeEvent(event, event_widget)
@@ -684,14 +684,11 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.updatePosition()
Gtk.EventBox.do_draw(self, cr)
- def _clickedCb(self, unused_action, unused_actor):
+ def __buttonReleaseEventCb(self, unused_action, unused_actor):
if self.timeline.got_dragged:
- # If the timeline just got dragged and @self
- # is the element initiating the mode,
- # do not do anything when the button is
- # released
+ # This means a drag & drop operation just finished and
+ # this button-release-event should be ignored.
self.timeline.got_dragged = False
-
return False
# TODO : Let's be more specific, masks etc ..
@@ -731,7 +728,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
return False
def _connectWidgetSignals(self):
- self.connect("button-release-event", self._clickedCb)
+ self.connect("button-release-event", self.__buttonReleaseEventCb)
self.connect("event", self._eventCb)
def release(self):
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 60b02df..1dbbcb6 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -663,6 +663,8 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
# drag and drop
def __setUpDragAndDrop(self):
+ # Set to True when a clip has been dragged because the first
+ # button-release-event on the clip should be ignored.
self.got_dragged = False
self.dropDataReady = False
self.dropData = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]