Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/frame/ZoomBox.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/view/frame/ZoomBox.py')
-rw-r--r--shell/view/frame/ZoomBox.py160
1 files changed, 80 insertions, 80 deletions
diff --git a/shell/view/frame/ZoomBox.py b/shell/view/frame/ZoomBox.py
index 45c76cd..ed7e0a1 100644
--- a/shell/view/frame/ZoomBox.py
+++ b/shell/view/frame/ZoomBox.py
@@ -23,98 +23,98 @@ from sugar.graphics import style
import sugar
class ActivityMenu(Menu):
- ACTION_SHARE = 1
- ACTION_CLOSE = 2
+ ACTION_SHARE = 1
+ ACTION_CLOSE = 2
- def __init__(self, activity_host):
- Menu.__init__(self, activity_host.get_title())
+ def __init__(self, activity_host):
+ Menu.__init__(self, activity_host.get_title())
- if not activity_host.get_shared():
- self._add_mesh_action()
+ if not activity_host.get_shared():
+ self._add_mesh_action()
- self._add_close_action()
+ self._add_close_action()
- def _add_mesh_action(self):
- icon = CanvasIcon(icon_name='stock-share-mesh')
- self.add_action(icon, ActivityMenu.ACTION_SHARE)
+ def _add_mesh_action(self):
+ icon = CanvasIcon(icon_name='stock-share-mesh')
+ self.add_action(icon, ActivityMenu.ACTION_SHARE)
- def _add_close_action(self):
- icon = CanvasIcon(icon_name='stock-close')
- self.add_action(icon, ActivityMenu.ACTION_CLOSE)
+ def _add_close_action(self):
+ icon = CanvasIcon(icon_name='stock-close')
+ self.add_action(icon, ActivityMenu.ACTION_CLOSE)
class ActivityIcon(MenuIcon):
- def __init__(self, shell, menu_shell, activity_host):
- self._shell = shell
- self._activity_host = activity_host
+ def __init__(self, shell, menu_shell, activity_host):
+ self._shell = shell
+ self._activity_host = activity_host
- icon_name = activity_host.get_icon_name()
- icon_color = activity_host.get_icon_color()
+ icon_name = activity_host.get_icon_name()
+ icon_color = activity_host.get_icon_color()
- MenuIcon.__init__(self, menu_shell, icon_name=icon_name,
- color=icon_color)
+ MenuIcon.__init__(self, menu_shell, icon_name=icon_name,
+ color=icon_color)
- def create_menu(self):
- menu = ActivityMenu(self._activity_host)
- menu.connect('action', self._action_cb)
- return menu
+ def create_menu(self):
+ menu = ActivityMenu(self._activity_host)
+ menu.connect('action', self._action_cb)
+ return menu
- def _action_cb(self, menu, action):
- self.popdown()
+ def _action_cb(self, menu, action):
+ self.popdown()
- activity = self._shell.get_current_activity()
- if activity == None:
- return
+ activity = self._shell.get_current_activity()
+ if activity == None:
+ return
- if action == ActivityMenu.ACTION_SHARE:
- activity.share()
- if action == ActivityMenu.ACTION_CLOSE:
- activity.close()
+ if action == ActivityMenu.ACTION_SHARE:
+ activity.share()
+ if action == ActivityMenu.ACTION_CLOSE:
+ activity.close()
class ZoomBox(hippo.CanvasBox):
- def __init__(self, shell, menu_shell):
- hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
-
- self._shell = shell
- self._menu_shell = menu_shell
- self._activity_icon = None
-
- icon = CanvasIcon(icon_name='stock-zoom-mesh')
- style.apply_stylesheet(icon, 'frame.ZoomIcon')
- icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_MESH)
- self.append(icon)
-
- icon = CanvasIcon(icon_name='stock-zoom-friends')
- style.apply_stylesheet(icon, 'frame.ZoomIcon')
- icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_FRIENDS)
- self.append(icon)
-
- icon = CanvasIcon(icon_name='stock-zoom-home')
- style.apply_stylesheet(icon, 'frame.ZoomIcon')
- icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_HOME)
- self.append(icon)
-
- icon = CanvasIcon(icon_name='stock-zoom-activity')
- style.apply_stylesheet(icon, 'frame.ZoomIcon')
- icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_ACTIVITY)
- self.append(icon)
-
- shell.connect('activity-changed', self._activity_changed_cb)
- self._set_current_activity(shell.get_current_activity())
-
- def _set_current_activity(self, activity):
- if self._activity_icon:
- self.remove(self._activity_icon)
-
- if activity:
- icon = ActivityIcon(self._shell, self._menu_shell, activity)
- style.apply_stylesheet(icon, 'frame.ZoomIcon')
- self.append(icon, 0)
- self._activity_icon = icon
- else:
- self._activity_icon = None
-
- def _activity_changed_cb(self, shell_model, activity):
- self._set_current_activity(activity)
-
- def _level_clicked_cb(self, item, level):
- self._shell.set_zoom_level(level)
+ def __init__(self, shell, menu_shell):
+ hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
+
+ self._shell = shell
+ self._menu_shell = menu_shell
+ self._activity_icon = None
+
+ icon = CanvasIcon(icon_name='stock-zoom-mesh')
+ style.apply_stylesheet(icon, 'frame.ZoomIcon')
+ icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_MESH)
+ self.append(icon)
+
+ icon = CanvasIcon(icon_name='stock-zoom-friends')
+ style.apply_stylesheet(icon, 'frame.ZoomIcon')
+ icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_FRIENDS)
+ self.append(icon)
+
+ icon = CanvasIcon(icon_name='stock-zoom-home')
+ style.apply_stylesheet(icon, 'frame.ZoomIcon')
+ icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_HOME)
+ self.append(icon)
+
+ icon = CanvasIcon(icon_name='stock-zoom-activity')
+ style.apply_stylesheet(icon, 'frame.ZoomIcon')
+ icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_ACTIVITY)
+ self.append(icon)
+
+ shell.connect('activity-changed', self._activity_changed_cb)
+ self._set_current_activity(shell.get_current_activity())
+
+ def _set_current_activity(self, activity):
+ if self._activity_icon:
+ self.remove(self._activity_icon)
+
+ if activity:
+ icon = ActivityIcon(self._shell, self._menu_shell, activity)
+ style.apply_stylesheet(icon, 'frame.ZoomIcon')
+ self.append(icon, 0)
+ self._activity_icon = icon
+ else:
+ self._activity_icon = None
+
+ def _activity_changed_cb(self, shell_model, activity):
+ self._set_current_activity(activity)
+
+ def _level_clicked_cb(self, item, level):
+ self._shell.set_zoom_level(level)