[pitivi] Make canvas spacing a constant and put it in __init__



commit 603f3c21787565cf4a339280122ca2b3f61827ac
Author: Paul Lange <palango gmx de>
Date:   Tue Jun 19 16:29:20 2012 +0200

    Make canvas spacing a constant and put it in __init__

 pitivi/timeline/timeline.py |    5 ++---
 pitivi/utils/ui.py          |    2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index b710b17..bff2a4f 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -52,7 +52,7 @@ from pitivi.dialogs.prefs import PreferencesDialog
 
 from pitivi.utils.receiver import receiver, handler
 from pitivi.utils.loggable import Loggable
-from pitivi.utils.ui import SPACING, unpack_cairo_pattern, \
+from pitivi.utils.ui import SPACING, CANVAS_SPACING, unpack_cairo_pattern, \
     LAYER_SPACING, TYPE_PITIVI_FILESOURCE, VIDEO_EFFECT_TUPLE, Point, \
     AUDIO_EFFECT_TUPLE, EFFECT_TUPLE, FILESOURCE_TUPLE, TYPE_PITIVI_EFFECT
 
@@ -185,7 +185,7 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
         Loggable.__init__(self)
         self.app = instance
         self._tracks = []
-        self.height = 0
+        self.height = CANVAS_SPACING
 
         self._block_size_request = False
         self.props.integer_layout = True
@@ -225,7 +225,6 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
         root.connect("button-release-event", self._selectionEnd)
         self.connect("button-release-event", self._snapEndedCb)
         # add some padding for the horizontal scrollbar
-        self.height += 21
         self.set_size_request(-1, self.height)
 
     def from_event(self, event):
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 0504719..8b80839 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -51,6 +51,8 @@ TRACK_SPACING = 8
 SPACING = 6
 PADDING = 6
 
+CANVAS_SPACING = 21
+
 ##
 #   Drag'n drop constants
 ##



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