2006-10-24 19:44:18 +02:00
|
|
|
import hippo
|
|
|
|
|
|
|
|
from sugar.graphics import style
|
|
|
|
from sugar.graphics.canvasicon import CanvasIcon
|
|
|
|
|
|
|
|
class OverlayBox(hippo.CanvasBox):
|
2006-12-04 20:12:24 +01:00
|
|
|
def __init__(self, shell):
|
|
|
|
hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
|
2006-10-24 19:44:18 +02:00
|
|
|
|
2006-12-04 20:12:24 +01:00
|
|
|
self._shell = shell
|
2006-10-24 19:44:18 +02:00
|
|
|
|
2007-01-12 21:35:53 +01:00
|
|
|
icon = CanvasIcon(icon_name='theme:stock-chat')
|
2006-12-04 20:12:24 +01:00
|
|
|
style.apply_stylesheet(icon, 'frame.OverlayIcon')
|
|
|
|
icon.connect('activated', self._overlay_clicked_cb)
|
|
|
|
self.append(icon)
|
2006-10-24 19:44:18 +02:00
|
|
|
|
2006-12-04 20:12:24 +01:00
|
|
|
def _overlay_clicked_cb(self, item):
|
|
|
|
self._shell.toggle_chat_visibility()
|