[pitivi: 2/11] scroll canvas by translating root item



commit f14b03e262f7ee74d835f25cf1cb9eff470c0f7e
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Fri Oct 1 14:34:38 2010 +0100

    scroll canvas by translating root item

 pitivi/ui/timeline.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/timeline.py b/pitivi/ui/timeline.py
index ece7597..f2ab6f4 100644
--- a/pitivi/ui/timeline.py
+++ b/pitivi/ui/timeline.py
@@ -272,6 +272,8 @@ class Timeline(gtk.Table, Loggable, Zoomable):
         self._vscrollbar = gtk.VScrollbar(self.vadj)
         self.attach(self._hscrollbar, 1, 2, 2, 3, yoptions=0)
         self.attach(self._vscrollbar, 2, 3, 1, 2, xoptions=0)
+        self.hadj.connect("value-changed", self._updateScrollPosition)
+        self.vadj.connect("value-changed", self._updateScrollPosition)
 
         # error infostub
         self.infostub = InfoStub()
@@ -527,6 +529,10 @@ class Timeline(gtk.Table, Loggable, Zoomable):
 
 ## Zooming and Scrolling
 
+    def _updateScrollPosition(self, adjustment):
+        self._root_item.set_simple_transform( -self.hadj.get_value(), 
+            -self.vadj.get_value(), 1.0, 0)
+
     def _zoomAdjustmentChangedCb(self, adjustment):
         # GTK crack
         self._updateZoom = False



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