diff options
author | Manuel Quiñones <manuq@laptop.org> | 2013-02-04 14:47:04 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2013-02-04 14:51:03 (GMT) |
commit | a7e0e5ae57f63035e50f48fe6f977cfa6c8d4572 (patch) | |
tree | 51ded92a8e3bed8d7efbdc86ed5c8d482b18abc4 | |
parent | 5ea6472e0d97208649e53ed951dca83692e6b786 (diff) |
Make the size of the preview image a public constant
Instead of hardcoding it.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
-rw-r--r-- | src/sugar3/activity/activity.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py index 3325f47..6a20c03 100644 --- a/src/sugar3/activity/activity.py +++ b/src/sugar3/activity/activity.py @@ -96,6 +96,8 @@ J_DBUS_INTERFACE = 'org.laptop.Journal' CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties' +PREVIEW_SIZE = style.zoom(300), style.zoom(225) + class _ActivitySession(GObject.GObject): @@ -639,8 +641,7 @@ class Activity(Window, Gtk.Container): this is what the user is seeing in this moment. Activities can override this method, which should return a str with the - binary content of a png image with a width of 300 and a height of 225 - pixels. + binary content of a png image with a width of PREVIEW_SIZE pixels. The method does create a cairo surface similar to that of the canvas' window and draws on that. Then we create a cairo image surface with @@ -666,7 +667,7 @@ class Activity(Window, Gtk.Container): self.canvas.draw(cr) del cr - preview_width, preview_height = style.zoom(300), style.zoom(225) + preview_width, preview_height = PREVIEW_SIZE preview_surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, preview_width, preview_height) cr = cairo.Context(preview_surface) |