Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
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
parent940b50b4e6d507b4e4a1e4a6aa42f418219df87b (diff)
Add hover to BuddyIcon in the Frame.
-rw-r--r--shell/view/BuddyMenu.py2
-rw-r--r--shell/view/frame/FriendsBox.py21
-rw-r--r--shell/view/frame/framepopupcontext.py2
-rw-r--r--sugar/graphics/snowflakebox.py2
4 files changed, 22 insertions, 5 deletions
diff --git a/shell/view/BuddyMenu.py b/shell/view/BuddyMenu.py
index b454822..ad4a5d4 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 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
diff --git a/shell/view/frame/framepopupcontext.py b/shell/view/frame/framepopupcontext.py
index b4b5c09..63304cc 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 9e2fd78..f0d446c 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()