[pitivi] timelinecanvas, trackobject: re-enable vertical movement
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] timelinecanvas, trackobject: re-enable vertical movement
- Date: Wed, 18 Mar 2009 14:08:44 -0400 (EDT)
commit 0c4ec667621bf836dce085b1d65ab49603339c74
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Sun Mar 15 01:29:42 2009 -0700
timelinecanvas, trackobject: re-enable vertical movement
---
pitivi/ui/timelinecanvas.py | 7 ++++---
pitivi/ui/track.py | 6 +++++-
pitivi/ui/trackobject.py | 4 ++--
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/pitivi/ui/timelinecanvas.py b/pitivi/ui/timelinecanvas.py
index b533f92..bfd7163 100644
--- a/pitivi/ui/timelinecanvas.py
+++ b/pitivi/ui/timelinecanvas.py
@@ -47,6 +47,7 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable):
Zoomable.__init__(self)
self._selected_sources = []
self._tracks = []
+ self._height = 0
self._block_size_request = False
self.props.integer_layout = True
@@ -190,9 +191,8 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable):
def _request_size(self):
w = Zoomable.nsToPixel(self.max_duration)
- h = 60 * len(self._tracks)
- self.set_bounds(0, 0, w, h)
- self._razor.props.height = h
+ self.set_bounds(0, 0, w, self._height)
+ self._razor.props.height = self._height
self.get_root_item().changed(True)
## Zoomable Override
@@ -233,4 +233,5 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable):
for i, track in enumerate(self._tracks):
track.set_simple_transform(0, height, 1, 0)
height += track.height + TRACK_SPACING
+ self._height = height
self._request_size()
diff --git a/pitivi/ui/track.py b/pitivi/ui/track.py
index fbe7d07..b269483 100644
--- a/pitivi/ui/track.py
+++ b/pitivi/ui/track.py
@@ -19,7 +19,7 @@ class Track(goocanvas.Group, Zoomable):
def getHeight(self):
if self.track.expanded:
- return (1 + self.max_priority) * (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)
+ return (1 + self.track.max_priority) * (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)
else:
return LAYER_HEIGHT_COLLAPSED + LAYER_SPACING
@@ -49,3 +49,7 @@ class Track(goocanvas.Group, Zoomable):
for widget in self.widgets.itervalues():
widget.expanded = track.expanded
self.get_canvas().regroupTracks()
+
+ @handler(track, "max-priority-changed")
+ def _maxPriorityChanged(self, track):
+ self.get_canvas().regroupTracks()
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index ca0c5c9..ba5368b 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -121,8 +121,8 @@ class TrackObject(View, goocanvas.Group, Zoomable):
x, y = pos
self._view.element.setStart(max(self._view.pixelToNs(x), 0),
snap=True)
- #priority = int(max(0, y // (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)))
- #self._view.element.priority = priority
+ priority = int(max(0, y // (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)))
+ self._view.element.priority = priority
def __init__(self, element, track, timeline):
goocanvas.Group.__init__(self)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]