diff --git a/shell/view/BuddyMenu.py b/shell/view/BuddyMenu.py index b4548224..ad4a5d40 100644 --- a/shell/view/BuddyMenu.py +++ b/shell/view/BuddyMenu.py @@ -35,6 +35,8 @@ class BuddyMenu(Menu): self._shell = shell Menu.__init__(self, buddy.get_name()) + self.props.border = 0 + self.props.padding = units.points_to_pixels(5) pixbuf = self._get_buddy_icon_pixbuf() if pixbuf: icon_item = hippo.CanvasImage() diff --git a/shell/view/frame/FriendsBox.py b/shell/view/frame/FriendsBox.py index 9b12f6c2..481b1288 100644 --- a/shell/view/frame/FriendsBox.py +++ b/shell/view/frame/FriendsBox.py @@ -17,15 +17,30 @@ import hippo from sugar.graphics.canvasicon import CanvasIcon +from sugar.graphics import color from sugar.presence import PresenceService from view.BuddyIcon import BuddyIcon from model.BuddyModel import BuddyModel +class FriendIcon(BuddyIcon): + def __init__(self, shell, popup_context, buddy): + BuddyIcon.__init__(self, shell, popup_context, buddy) + self._popup_context = popup_context + + def get_popup_context(self): + return self._popup_context + + def prelight(self, enter): + if enter: + self.props.background_color = color.BLACK.get_int() + else: + self.props.background_color = color.TOOLBAR_BACKGROUND.get_int() + class FriendsBox(hippo.CanvasBox): - def __init__(self, shell, menu_shell): + def __init__(self, shell, popup_context): hippo.CanvasBox.__init__(self) self._shell = shell - self._menu_shell = menu_shell + self._popup_context = popup_context self._activity_ps = None self._joined_hid = -1 self._left_hid = -1 @@ -48,7 +63,7 @@ class FriendsBox(hippo.CanvasBox): return model = BuddyModel(buddy=buddy) - icon = BuddyIcon(self._shell, self._menu_shell, model) + icon = FriendIcon(self._shell, self._popup_context, model) self.append(icon) self._buddies[buddy.get_name()] = icon diff --git a/shell/view/frame/framepopupcontext.py b/shell/view/frame/framepopupcontext.py index b4b5c094..63304cc1 100644 --- a/shell/view/frame/framepopupcontext.py +++ b/shell/view/frame/framepopupcontext.py @@ -36,7 +36,7 @@ class FramePopupContext(PopupContext): left_x = item_x + item_w left_y = item_y - right_x = item_x + item_w + right_x = item_x - popup_w right_y = item_y top_x = item_x top_y = item_y + item_h diff --git a/sugar/graphics/snowflakebox.py b/sugar/graphics/snowflakebox.py index 9e2fd784..f0d446c2 100644 --- a/sugar/graphics/snowflakebox.py +++ b/sugar/graphics/snowflakebox.py @@ -85,7 +85,7 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem): return width def do_allocate(self, width, height, origin_changed): - hippo.CanvasBox.do_allocate(self, width, height) + hippo.CanvasBox.do_allocate(self, width, height, origin_changed) self._layout_root()