[pitivi] Hide last separator



commit d965aba0a0d7a31888896c9efc135bc121cec25e
Author: Paul Lange <palango gmx de>
Date:   Fri Jul 6 17:00:06 2012 +0200

    Hide last separator

 pitivi/timeline/layer.py    |    6 ++++++
 pitivi/timeline/timeline.py |    9 +++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index f87a62a..3e0c867 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -200,6 +200,12 @@ class BaseLayerControl(gtk.VBox, Loggable):
     def setSoloState(self, state):
         self.solo_button.set_active(state)
 
+    def setSeparatorVisibility(self, visible):
+        if visible:
+            self.sep.show()
+        else:
+            self.sep.hide()
+
 
 class VideoLayerControl(BaseLayerControl):
     """
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 926b6d6..8e7c218 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -550,6 +550,7 @@ class TimelineControls(gtk.VBox, Loggable):
         video_control.show()
 
         self._orderControls()
+        self._hideLastSeparator()
 
     def _orderControls(self):
         i = 0
@@ -562,6 +563,13 @@ class TimelineControls(gtk.VBox, Loggable):
                 self.reorder_child(child, j)
                 j += 1
 
+    def _hideLastSeparator(self):
+        if self.children():
+            for child in self.children():
+                child.setSeparatorVisibility(True)
+
+            self.children()[-1].setSeparatorVisibility(False)
+
     def _layerRemovedCb(self, timeline, layer):
         audio_control = self._layer_controls[layer][ges.TRACK_TYPE_AUDIO]
         video_control = self._layer_controls[layer][ges.TRACK_TYPE_VIDEO]
@@ -570,6 +578,7 @@ class TimelineControls(gtk.VBox, Loggable):
         self.remove(video_control)
 
         del self._layer_controls[layer]
+        self._hideLastSeparator()
 
     def getHeightOfLayer(self, track_type, layer):
         if track_type == ges.TRACK_TYPE_VIDEO:



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