diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-19 00:00:04 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-19 00:00:04 (GMT) |
commit | de65daf5480b673df26c5144925c8041a766cc87 (patch) | |
tree | 313c1b856d1dd7be2ab630e202a7f68e908c72b2 /shell/Shell.py | |
parent | 24dae31a9d1bb2141db3bfd0364f2d95219fc7fa (diff) |
Implement zooming levels, actual view still empty
Diffstat (limited to 'shell/Shell.py')
-rwxr-xr-x | shell/Shell.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/shell/Shell.py b/shell/Shell.py index ad4db5b..c8ebe06 100755 --- a/shell/Shell.py +++ b/shell/Shell.py @@ -37,7 +37,20 @@ class ShellDbusService(dbus.service.Object): def show_console(self): gobject.idle_add(self.__show_console_idle) + @dbus.service.method('com.redhat.Sugar.Shell') + def zoom_in(self): + self._shell.zoom_in() + + @dbus.service.method('com.redhat.Sugar.Shell') + def zoom_out(self): + self._shell.zoom_out() + class Shell(gobject.GObject): + ZOOM_MESH = 0 + ZOOM_FRIENDS = 1 + ZOOM_HOME = 2 + ZOOM_ACTIVITY = 3 + __gsignals__ = { 'activity-opened': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([gobject.TYPE_PYOBJECT])), @@ -51,6 +64,7 @@ class Shell(gobject.GObject): self._screen = wnck.screen_get_default() self._registry = registry self._hosts = {} + self._zoom_level = Shell.ZOOM_HOME def start(self): session_bus = dbus.SessionBus() @@ -159,3 +173,28 @@ class Shell(gobject.GObject): def get_chat_controller(self): return self._chat_controller + + def _set_zoom_level(self, level): + self._zoom_level = level + + if level == Shell.ZOOM_ACTIVITY: + self._screen.toggle_showing_desktop(False) + else: + self._screen.toggle_showing_desktop(True) + + if level == Shell.ZOOM_HOME: + self._home_window.set_view(HomeWindow.HOME_VIEW) + elif level == Shell.ZOOM_FRIENDS: + self._home_window.set_view(HomeWindow.FRIENDS_VIEW) + elif level == Shell.ZOOM_MESH: + self._home_window.set_view(HomeWindow.MESH_VIEW) + + def zoom_in(self): + level = self._zoom_level + 1 + if level <= Shell.ZOOM_ACTIVITY: + self._set_zoom_level(level) + + def zoom_out(self): + level = self._zoom_level - 1 + if level >= Shell.ZOOM_MESH: + self._set_zoom_level(level) |