[pitivi] timeline: Fix showing layer controls on loaded project



commit 07ac54315353e4720c603c4d2ff67bc49ea7fe13
Author: Thibault Saunier <tsaunier gnome org>
Date:   Wed Sep 23 17:28:50 2015 +0200

    timeline: Fix showing layer controls on loaded project
    
    Force show_all on them when we know we want to show them but set
    no-show-all so that when we do timeline_container.show_all() they
    not show up.

 pitivi/timeline/layer.py    |   14 ++++++++++----
 pitivi/timeline/timeline.py |    5 -----
 2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 3582a89..c554dbb 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -52,6 +52,7 @@ class BaseLayerControl(Gtk.Box, Loggable):
         self._selected = False
         self.__type_name = type_name
         self.__meta_name = type_name + "::name"
+        self.props.no_show_all = True
 
         context = self.get_style_context()
 
@@ -114,6 +115,11 @@ class BaseLayerControl(Gtk.Box, Loggable):
             self._selected = selected
             self._selectionChangedCb()
 
+    def force_show_all(self):
+        self.props.no_show_all = False
+        self.show_all()
+        self.props.no_show_all = True
+
     selected = property(getSelected, setSelected, None, "Selection state")
 
     def _selectionChangedCb(self):
@@ -271,13 +277,13 @@ class LayerControls(Gtk.EventBox, Loggable):
         content.attach(self.before_sep, 0, 0, 2, 1)
 
         self.video_control = VideoLayerControl(self, self.app)
-        self.video_control.set_visible(True)
+        self.video_control.force_show_all()
         self.video_control.props.height_request = ui.LAYER_HEIGHT / 2
         self.video_control.props.hexpand = True
         content.attach(self.video_control, 0, 1, 1, 1)
 
         self.audio_control = AudioLayerControl(self, self.app)
-        self.audio_control.set_visible(True)
+        self.audio_control.force_show_all()
         self.audio_control.props.height_request = ui.LAYER_HEIGHT / 2
         self.audio_control.props.hexpand = True
         content.attach(self.audio_control, 0, 2, 1, 1)
@@ -504,12 +510,12 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         height = 0
         if self.media_types & GES.TrackType.AUDIO:
             height += ui.LAYER_HEIGHT / 2
-            self.bLayer.control_ui.audio_control.show()
+            self.bLayer.control_ui.audio_control.force_show_all()
         else:
             self.bLayer.control_ui.audio_control.hide()
 
         if self.media_types & GES.TrackType.VIDEO:
-            self.bLayer.control_ui.video_control.show()
+            self.bLayer.control_ui.video_control.force_show_all()
             height += ui.LAYER_HEIGHT / 2
         else:
             self.bLayer.control_ui.video_control.hide()
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 9cbd74e..fa68079 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1057,11 +1057,6 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         """
         Get the layer to which the clip should land, creating
         layer as necessary.
-
-        If always_create_layer is True, a new layer with proper
-        priority will be created, otherwize it will try to retrieve
-        the layer at the priority and create only if it does not
-        exist
         """
         priority = self._on_layer.props.priority
         if self.__on_separators[0] == self._on_layer.ui.after_sep:


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