Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/frame/TopPanel.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/view/frame/TopPanel.py')
-rw-r--r--shell/view/frame/TopPanel.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/shell/view/frame/TopPanel.py b/shell/view/frame/TopPanel.py
index 188a7d7..35df67f 100644
--- a/shell/view/frame/TopPanel.py
+++ b/shell/view/frame/TopPanel.py
@@ -9,6 +9,7 @@ import sugar
class ActivityMenu(Menu):
ACTION_SHARE = 1
+ ACTION_CLOSE = 2
def __init__(self, grid, activity_host):
title = activity_host.get_title()
@@ -17,6 +18,9 @@ class ActivityMenu(Menu):
icon = IconItem(icon_name='stock-share')
self.add_action(icon, ActivityMenu.ACTION_SHARE)
+ icon = IconItem(icon_name='stock-close-activity')
+ self.add_action(icon, ActivityMenu.ACTION_CLOSE)
+
class ActivityIcon(MenuIcon):
def __init__(self, shell, activity_host):
self._shell = shell
@@ -36,10 +40,16 @@ class ActivityIcon(MenuIcon):
return menu
def _action_cb(self, menu, action):
+ self.popdown()
+
+ activity = self._shell.get_current_activity()
+ if activity == None:
+ return
+
if action == ActivityMenu.ACTION_SHARE:
- activity = shell.get_current_activity()
- if activity != None:
- activity.share()
+ activity.share()
+ if action == ActivityMenu.ACTION_CLOSE:
+ activity.close()
class TopPanel(goocanvas.Group):
def __init__(self, shell):