Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sugar/graphics/canvasicon.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py
index 25368ff..d809a6b 100644
--- a/sugar/graphics/canvasicon.py
+++ b/sugar/graphics/canvasicon.py
@@ -166,6 +166,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
self._palette = None
hippo.CanvasBox.__init__(self, **kwargs)
+
+ self.connect_after('motion-notify-event', self._motion_notify_event_cb)
def _clear_buffers(self):
cur_buf_key = self._get_current_buffer_key()
@@ -314,6 +316,13 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
self.emit_activated()
return True
+ def _motion_notify_event_cb(self, button, event):
+ if event.detail == hippo.MOTION_DETAIL_ENTER:
+ self.prelight(True)
+ elif event.detail == hippo.MOTION_DETAIL_LEAVE:
+ self.prelight(False)
+ return False
+
def prelight(self, enter):
"""
Override this method for adding prelighting behavior.