Merge branch 'master' of git://dev.laptop.org/sugar

This commit is contained in:
Tomeu Vizoso 2007-07-02 12:39:37 +02:00
commit 59bf818e99
2 changed files with 31 additions and 0 deletions

View File

@ -115,6 +115,9 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
def has_activities(self):
return self._donut.has_activities()
def enable_xo_palette(self):
self._my_icon.enable_palette()
def grab_and_rotate(self):
pass
@ -130,6 +133,8 @@ class HomeMyIcon(MyIcon):
MyIcon.__init__(self, scale)
self._shell = shell
def enable_palette(self):
self.set_tooltip(profile.get_nick_name())
shutdown_menu_item = gtk.MenuItem(_('Shutdown'))

View File

@ -52,6 +52,13 @@ class HomeWindow(gtk.Window):
self.connect('focus-in-event', self._focus_in_cb)
self.connect('focus-out-event', self._focus_out_cb)
self._enter_sid = self.connect('enter-notify-event',
self._enter_notify_event_cb)
self._leave_sid = self.connect('leave-notify-event',
self._leave_notify_event_cb)
self._motion_sid = self.connect('motion-notify-event',
self._motion_notify_event_cb)
self._home_box = HomeBox(shell)
self._friends_box = FriendsBox(shell)
self._mesh_box = MeshBox(shell)
@ -62,6 +69,25 @@ class HomeWindow(gtk.Window):
self._transition_box.connect('completed',
self._transition_completed_cb)
def _enter_notify_event_cb(self, window, event):
if event.x != gtk.gdk.screen_width() / 2 or \
event.y != gtk.gdk.screen_height() / 2:
self._mouse_moved()
def _leave_notify_event_cb(self, window, event):
self._mouse_moved()
def _motion_notify_event_cb(self, window, event):
self._mouse_moved()
# We want to enable the XO palette only when the user
# moved away from the default mouse position (screen center).
def _mouse_moved(self):
self._home_box.enable_xo_palette()
self.disconnect(self._leave_sid)
self.disconnect(self._motion_sid)
self.disconnect(self._enter_sid)
def _key_release_cb(self, widget, event):
keyname = gtk.gdk.keyval_name(event.keyval)
if keyname == "Alt_L":