diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-07 09:08:02 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-07 09:08:02 (GMT) |
commit | d0ba3b63ec337793c9d6446810e055ebd18f22c8 (patch) | |
tree | 394b9dd05dfd63e461a9f586d2d7f39ad076fc04 /src | |
parent | d4b76298019eddf9b306e58ab6608224514e3830 (diff) |
Add a launch box in the home window, which is displayed
in the activity zoom level.
Diffstat (limited to 'src')
-rw-r--r-- | src/view/home/HomeWindow.py | 11 | ||||
-rw-r--r-- | src/view/home/Makefile.am | 1 | ||||
-rw-r--r-- | src/view/home/launchbox.py | 26 |
3 files changed, 38 insertions, 0 deletions
diff --git a/src/view/home/HomeWindow.py b/src/view/home/HomeWindow.py index 7e0a0c5..9500b02 100644 --- a/src/view/home/HomeWindow.py +++ b/src/view/home/HomeWindow.py @@ -24,12 +24,14 @@ from view.home.MeshBox import MeshBox from view.home.HomeBox import HomeBox from view.home.FriendsBox import FriendsBox from view.home.transitionbox import TransitionBox +from view.home.launchbox import LaunchBox from model.shellmodel import ShellModel _HOME_PAGE = 0 _FRIENDS_PAGE = 1 _MESH_PAGE = 2 _TRANSITION_PAGE = 3 +_LAUNCH_PAGE = 4 class HomeWindow(gtk.Window): def __init__(self): @@ -65,6 +67,7 @@ class HomeWindow(gtk.Window): self._friends_box = FriendsBox() self._mesh_box = MeshBox() self._transition_box = TransitionBox() + self._launch_box = LaunchBox() self._activate_view() self._canvas.set_root(self._home_box) @@ -98,12 +101,16 @@ class HomeWindow(gtk.Window): self._home_box.suspend() elif self._level == ShellModel.ZOOM_MESH: self._mesh_box.suspend() + elif self._level == ShellModel.ZOOM_ACTIVITY: + self._launch_box.suspend() def _activate_view(self): if self._level == ShellModel.ZOOM_HOME: self._home_box.resume() elif self._level == ShellModel.ZOOM_MESH: self._mesh_box.resume() + elif self._level == ShellModel.ZOOM_ACTIVITY: + self._launch_box.resume() def _visibility_notify_event_cb(self, window, event): if event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED: @@ -124,6 +131,8 @@ class HomeWindow(gtk.Window): size = style.LARGE_ICON_SIZE elif level == ShellModel.ZOOM_MESH: size = style.STANDARD_ICON_SIZE + elif level == ShellModel.ZOOM_ACTIVIY: + size = style.XLARGE_ICON_SIZE self._transition_box.set_size(size) @@ -135,6 +144,8 @@ class HomeWindow(gtk.Window): elif self._level == ShellModel.ZOOM_MESH: self._canvas.set_root(self._mesh_box) self._mesh_box.focus_search_entry() + elif self._level == ShellModel.ZOOM_ACTIVITY: + self._canvas.set_root(self._launch_box) def get_home_box(self): return self._home_box diff --git a/src/view/home/Makefile.am b/src/view/home/Makefile.am index 4ae3410..5306e2b 100644 --- a/src/view/home/Makefile.am +++ b/src/view/home/Makefile.am @@ -5,6 +5,7 @@ sugar_PYTHON = \ activitiesring.py \ FriendView.py \ FriendsBox.py \ + launchbox.py \ HomeBox.py \ HomeWindow.py \ MeshBox.py \ diff --git a/src/view/home/launchbox.py b/src/view/home/launchbox.py new file mode 100644 index 0000000..addda39 --- /dev/null +++ b/src/view/home/launchbox.py @@ -0,0 +1,26 @@ +# Copyright (C) 2008, Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import hippo +import gobject + +from sugar.graphics import style + +class LaunchBox(hippo.CanvasBox): + def __init__(self): + gobject.GObject.__init__( + self, background_color=style.COLOR_WHITE.get_int()) + |