[pitivi] widgets: Fix the zoom slider not showing the initial zoom value



commit 8551d7d6b9177db45079cfe29992839eda781c20
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Dec 17 18:03:03 2013 +0100

    widgets: Fix the zoom slider not showing the initial zoom value

 pitivi/utils/widgets.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index da36bdf..489773b 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -1059,11 +1059,13 @@ class ZoomBox(Gtk.HBox, Zoomable):
 
         # zooming slider
         self._zoomAdjustment = Gtk.Adjustment()
-        self._zoomAdjustment.set_value(Zoomable.getCurrentZoomLevel())
-        self._zoomAdjustment.connect("value-changed", self._zoomAdjustmentChangedCb)
         self._zoomAdjustment.props.lower = 0
         self._zoomAdjustment.props.upper = Zoomable.zoom_steps
         zoomslider = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL, adjustment=self._zoomAdjustment)
+        # Setting _zoomAdjustment's value must be done after we create the
+        # zoom slider, otherwise the slider remains at the leftmost position.
+        self._zoomAdjustment.set_value(Zoomable.getCurrentZoomLevel())
+        self._zoomAdjustment.connect("value-changed", self._zoomAdjustmentChangedCb)
         zoomslider.props.draw_value = False
         zoomslider.set_tooltip_text(_("Zoom Timeline"))
         zoomslider.connect("scroll-event", self._zoomSliderScrollCb)


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