Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/medalscreen.py
diff options
context:
space:
mode:
authorLive System User <liveuser@localhost.localdomain>2009-02-26 03:17:26 (GMT)
committer Live System User <liveuser@localhost.localdomain>2009-02-26 03:17:26 (GMT)
commite0085fa68f82c5dd5c0320e4cd8a49c128a0adbc (patch)
treefb4793494d2c142076ed7892020d7c04d5f5be84 /medalscreen.py
parentc6619e0bec3cb53fdb42f35cb26b24fbbb2cdfce (diff)
Resolution independent medal images.
Diffstat (limited to 'medalscreen.py')
-rw-r--r--medalscreen.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/medalscreen.py b/medalscreen.py
index 45d0124..42833bf 100644
--- a/medalscreen.py
+++ b/medalscreen.py
@@ -23,9 +23,11 @@ import gobject, pygtk, gtk, pango
# Import Sugar UI modules.
import sugar.activity.activity
-from sugar.graphics import *
+import sugar.graphics.style
class MedalScreen(gtk.EventBox):
+ MEDAL_SIZE = int(4.5 * sugar.graphics.style.GRID_CELL_SIZE)
+
def __init__(self, medal, activity):
gtk.EventBox.__init__(self)
@@ -36,14 +38,13 @@ class MedalScreen(gtk.EventBox):
# Load the image.
medal_type = medal['type']
- bundle = sugar.activity.activity.get_bundle_path()
images = {
- 'bronze': bundle+'/images/bronze-medal.svg',
- 'silver': bundle+'/images/silver-medal.svg',
- 'gold': bundle+'/images/gold-medal.svg'
+ 'bronze': 'images/bronze-medal.svg',
+ 'silver': 'images/silver-medal.svg',
+ 'gold': 'images/gold-medal.svg'
}
medalpixbuf = gtk.gdk.pixbuf_new_from_file(images[medal_type])
- medalpixbuf = medalpixbuf.scale_simple(350, 350, gtk.gdk.INTERP_BILINEAR)
+ medalpixbuf = medalpixbuf.scale_simple(MedalScreen.MEDAL_SIZE, MedalScreen.MEDAL_SIZE, gtk.gdk.INTERP_BILINEAR)
medalimage = gtk.Image()
medalimage.set_from_pixbuf(medalpixbuf)