[pitivi/gtktimeline: 25/28] layer: Do not resize layers during edition
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/gtktimeline: 25/28] layer: Do not resize layers during edition
- Date: Tue, 5 May 2015 07:52:03 +0000 (UTC)
commit 6b57cb3fbaf1bb0ab434a9303a2a1b2eff15fde1
Author: Thibault Saunier <tsaunier gnome org>
Date: Sat May 2 11:32:13 2015 +0200
layer: Do not resize layers during edition
Summary:
Otherwize the UI moves and it is very hard for the user to do what he
wants when moving clips between layers
Reviewers: Mathieu_Du
Differential Revision: http://phabricator.freedesktop.org/D143
pitivi/timeline/layer.py | 14 +++++++++-----
pitivi/timeline/timeline.py | 3 +++
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 4628f8a..784ddd3 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -523,7 +523,11 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.before_sep = None
self.after_sep = None
- def _checkMediaTypes(self, bClip=None):
+ def checkMediaTypes(self, bClip=None):
+ if self.timeline.editing_context:
+ self.info("Not updating media types as"
+ " we are editing the timeline")
+ return
self.media_types = GES.TrackType(0)
bClips = self.bLayer.get_clips()
@@ -563,10 +567,10 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self._layout.move(child, x, y)
def _childAddedCb(self, bClip, child):
- self._checkMediaTypes()
+ self.checkMediaTypes()
def _childRemovedCb(self, bClip, child):
- self._checkMediaTypes()
+ self.checkMediaTypes()
def _clipAddedCb(self, layer, bClip):
self._addClip(bClip)
@@ -586,7 +590,7 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.show_all()
bClip.connect_after("child-added", self._childAddedCb)
bClip.connect_after("child-removed", self._childRemovedCb)
- self._checkMediaTypes()
+ self.checkMediaTypes()
def _clipRemovedCb(self, bLayer, bClip):
self._removeClip(bClip)
@@ -603,7 +607,7 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
bClip.disconnect_by_func(self._childAddedCb)
bClip.disconnect_by_func(self._childRemovedCb)
- self._checkMediaTypes(bClip)
+ self.checkMediaTypes(bClip)
def updatePosition(self):
for bClip in self.bLayer.get_clips():
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 1e0854a..ff5cf9f 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -931,6 +931,9 @@ class Timeline(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.editing_context = None
self.hideSnapBar()
+ for layer in self.bTimeline.get_layers():
+ layer.ui.checkMediaTypes()
+
self.__unsetHoverSeparators()
self.__on_separators = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]