[pitivi/gtktimeline] elements: Make sure to update clip position when a child is added/removed
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/gtktimeline] elements: Make sure to update clip position when a child is added/removed
- Date: Thu, 14 May 2015 07:47:54 +0000 (UTC)
commit 1ed11963b7102c339f5fc4736b3936576bb93026
Author: Thibault Saunier <tsaunier gnome org>
Date: Thu May 14 09:45:23 2015 +0200
elements: Make sure to update clip position when a child is added/removed
So that children get notified about the change and can update
themselves.
Fixes http://phabricator.freedesktop.org/T64
pitivi/timeline/elements.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 21a1b74..be4a319 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -584,6 +584,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
return parent.get_allocated_height(), parent.get_allocated_height()
def _savePositionState(self):
+ self.__force_position_update = False
self._current_x = self.nsToPixel(self.bClip.props.start)
self._curent_width = self.nsToPixel(self.bClip.props.duration)
parent = self.get_parent()
@@ -600,7 +601,8 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
width = self.nsToPixel(self.bClip.props.duration)
parent_height = parent.get_allocated_height()
- if x != self._current_x or \
+ if self.__force_position_update or \
+ x != self._current_x or \
width != self._curent_width \
or parent_height != self._current_parent_height or \
parent != self._current_parent:
@@ -732,6 +734,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.__showHandles()
def _childAddedCb(self, clip, child):
+ self.__force_position_update = True
self._childAdded(clip, child)
self.__connectToChild(child)
@@ -739,6 +742,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
pass
def _childRemovedCb(self, clip, child):
+ self.__force_position_update = True
if child.ui:
child.ui.disconnect_by_func(self.__curveEnterCb)
child.ui.disconnect_by_func(self.__curveLeaveCb)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]