Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-12-21 07:10:21 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-12-21 07:10:21 (GMT)
commit5512f8461bfadc1bd534ee38b09c8582eadd3b00 (patch)
treeb3700460bb29c31d97200ee5f9ebc88e12962a20
parentaf889e2b897ac0d8f4dbadd28cecd15ec762d7f3 (diff)
Re-enable buddy icons in rollover menus
-rw-r--r--shell/view/BuddyMenu.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/shell/view/BuddyMenu.py b/shell/view/BuddyMenu.py
index 069aa6a..a020a59 100644
--- a/shell/view/BuddyMenu.py
+++ b/shell/view/BuddyMenu.py
@@ -21,6 +21,7 @@ import hippo
from sugar.graphics.menu import Menu
from sugar.graphics.canvasicon import CanvasIcon
from sugar.presence import PresenceService
+import _sugar
_ICON_SIZE = 75
@@ -33,15 +34,19 @@ class BuddyMenu(Menu):
self._buddy = buddy
self._shell = shell
- icon_item = None
pixbuf = self._get_buddy_icon_pixbuf()
if pixbuf:
+ icon_item = hippo.CanvasImage()
scaled_pixbuf = pixbuf.scale_simple(_ICON_SIZE, _ICON_SIZE,
gtk.gdk.INTERP_BILINEAR)
del pixbuf
- icon_item = hippo.CanvasImage(pixbuf=scaled_pixbuf)
-
- Menu.__init__(self, buddy.get_name(), icon_item)
+ Menu.__init__(self, buddy.get_name(), icon_item)
+ # FIXME: have to set the image _after_ adding the HippoCanvasImage
+ # to it's parent item, because that sets the HippoCanvasImage's context,
+ # which resets the object's 'image' property. Grr.
+ _sugar.hippo_canvas_image_set_image_from_gdk_pixbuf(icon_item, scaled_pixbuf)
+ else:
+ Menu.__init__(self, buddy.get_name(), None)
self._buddy.connect('icon-changed', self.__buddy_icon_changed_cb)