Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/frame/FriendsBox.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-24 13:58:38 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-02-24 13:58:38 (GMT)
commitce800fbc66c2790f5bf9a38006812a16478342aa (patch)
tree2fe18bd93c0b15e39da3257fdc4fd3c8c341f1de /shell/view/frame/FriendsBox.py
parent940b50b4e6d507b4e4a1e4a6aa42f418219df87b (diff)
Add hover to BuddyIcon in the Frame.
Diffstat (limited to 'shell/view/frame/FriendsBox.py')
-rw-r--r--shell/view/frame/FriendsBox.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/shell/view/frame/FriendsBox.py b/shell/view/frame/FriendsBox.py
index 9b12f6c..481b128 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