[pitivi: 5/8] update canvas size in response to size-allocate signal
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 5/8] update canvas size in response to size-allocate signal
- Date: Sat, 16 Oct 2010 10:09:21 +0000 (UTC)
commit 34164feffd2b8c91376e85559d27d6161abd88e2
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Fri Oct 15 10:11:33 2010 +0100
update canvas size in response to size-allocate signal
pitivi/ui/timelinecanvas.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/ui/timelinecanvas.py b/pitivi/ui/timelinecanvas.py
index 969ff3f..9e4b3cd 100644
--- a/pitivi/ui/timelinecanvas.py
+++ b/pitivi/ui/timelinecanvas.py
@@ -115,6 +115,7 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
stroke_color_rgba=0xFFFFFFFF,
width=3)
self._playhead_controller = PlayheadController(self._playhead)
+ self.connect("size-allocate", self._size_allocate_cb)
root.connect("motion-notify-event", self._selectionDrag)
root.connect("button-press-event", self._selectionStart)
root.connect("button-release-event", self._selectionEnd)
@@ -274,8 +275,11 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
def _request_size(self):
alloc = self.get_allocation()
self.set_bounds(0, 0, alloc.width, alloc.height)
- self._playhead.props.height = max(alloc.width,
- self.tracks.get_bounds().y2 + 10)
+ self._playhead.props.height = (max(alloc.height,
+ self.tracks.get_bounds().y2) + 10)
+
+ def _size_allocate_cb (self, widget, allocation):
+ self._request_size()
def zoomChanged(self):
self.queue_draw()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]