Restore CanvasIcon prelighting.

This commit is contained in:
Tomeu Vizoso 2007-07-01 11:33:12 +02:00
parent 84c94ecabe
commit 92ec6f72d8

View File

@ -167,6 +167,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
hippo.CanvasBox.__init__(self, **kwargs) hippo.CanvasBox.__init__(self, **kwargs)
self.connect_after('motion-notify-event', self._motion_notify_event_cb)
def _clear_buffers(self): def _clear_buffers(self):
cur_buf_key = self._get_current_buffer_key() cur_buf_key = self._get_current_buffer_key()
for key in self._buffers.keys(): for key in self._buffers.keys():
@ -314,6 +316,13 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
self.emit_activated() self.emit_activated()
return True 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): def prelight(self, enter):
""" """
Override this method for adding prelighting behavior. Override this method for adding prelighting behavior.