[pitivi] timeline: Use ScrolledWindow instead of Viewport



commit a2d3556bd3204cf86dd599a7a5a0bc918d44a3b5
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Wed Nov 2 12:48:06 2016 +0100

    timeline: Use ScrolledWindow instead of Viewport
    
    The Viewport surfaces its child's minimum size as its own and because of
    this GTK warnings are printed when the size is smaller than the minimum.
    
    Differential Revision: https://phabricator.freedesktop.org/D1439

 pitivi/timeline/timeline.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ec92a8f..eb0e3ba 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -339,11 +339,13 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         self._layers_controls_vbox.props.valign = Gtk.Align.START
         size_group.add_widget(self._layers_controls_vbox)
 
-        # Stuff the layers controls in a viewport so it can be scrolled.
-        viewport = Gtk.Viewport(vadjustment=self.vadj)
-        viewport.add(self._layers_controls_vbox)
-        clear_styles(viewport)
-        hbox.pack_start(viewport, False, False, 0)
+        # Stuff the layers controls in a ScrolledWindow so they can be scrolled.
+        # Use self.layout's hadj to scroll the controls in sync with the layers.
+        scrolled_window = Gtk.ScrolledWindow(vadjustment=self.vadj)
+        scrolled_window.props.propagate_natural_width = True
+        scrolled_window.props.vscrollbar_policy = Gtk.PolicyType.EXTERNAL
+        scrolled_window.add(self._layers_controls_vbox)
+        hbox.pack_start(scrolled_window, False, False, 0)
 
         self.get_style_context().add_class("Timeline")
         self.props.expand = True


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