[pitivi] preview.py: add border around thumbnails
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] preview.py: add border around thumbnails
- Date: Thu, 24 Sep 2009 15:31:01 +0000 (UTC)
commit 2dd940eaeee48ddaa1f87f2b0a30c6d63e304d0e
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Tue Sep 22 14:57:57 2009 -0700
preview.py: add border around thumbnails
pitivi/ui/preview.py | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/ui/preview.py b/pitivi/ui/preview.py
index 2364fca..7360c48 100644
--- a/pitivi/ui/preview.py
+++ b/pitivi/ui/preview.py
@@ -42,7 +42,7 @@ class Preview(goocanvas.ItemSimple, goocanvas.Item, Zoomable):
__gtype_name__ = 'Preview'
- def __init__(self, element, height=50, **kwargs):
+ def __init__(self, element, height=46, **kwargs):
super(Preview, self).__init__(**kwargs)
Zoomable.__init__(self)
self.height = float(height)
@@ -75,7 +75,12 @@ class Preview(goocanvas.ItemSimple, goocanvas.Item, Zoomable):
@handler(previewer, "update")
def _update_preview(self, previewer, segment):
- self.changed(False)
+ # if segment is none we are not just drawing a new thumbnail, so we
+ # should update bounds
+ if segment == None:
+ self.changed(True)
+ else:
+ self.changed(False)
## Zoomable interface overries
@@ -87,10 +92,14 @@ class Preview(goocanvas.ItemSimple, goocanvas.Item, Zoomable):
def do_simple_update(self, cr):
cr.identity_matrix()
if self.element.factory:
- self.bounds = goocanvas.Bounds(0, 0,
- Zoomable.nsToPixel(self.element.duration), self.height)
+ border_width = self.previewer._spacing()
+ self.bounds = goocanvas.Bounds(border_width, 4,
+ max(0, Zoomable.nsToPixel(self.element.duration) -
+ border_width), self.height)
def do_simple_paint(self, cr, bounds):
+
+
cr.identity_matrix()
if self.element.factory:
self.previewer.render_cairo(cr, intersect(self.bounds, bounds),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]