Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/view/Shell.py4
-rw-r--r--shell/view/frame/Frame.py9
-rw-r--r--shell/view/frame/overlaybox.py18
-rw-r--r--shell/view/stylesheet.py4
4 files changed, 32 insertions, 3 deletions
diff --git a/shell/view/Shell.py b/shell/view/Shell.py
index 29305cd..deaa889 100644
--- a/shell/view/Shell.py
+++ b/shell/view/Shell.py
@@ -88,7 +88,7 @@ class Shell(gobject.GObject):
elif key == 'F6':
self.start_activity('org.sugar.Terminal')
elif key == 'F9':
- self._show_hide_activity_chat()
+ self.toggle_chat_visibility()
def __global_key_released_cb(self, grabber, key):
if key == 'F5':
@@ -182,7 +182,7 @@ class Shell(gobject.GObject):
return host
return None
- def _show_hide_activity_chat(self):
+ def toggle_chat_visibility(self):
act = self.get_current_activity()
if not act:
return
diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py
index 64c7585..80fb4d1 100644
--- a/shell/view/frame/Frame.py
+++ b/shell/view/frame/Frame.py
@@ -21,6 +21,7 @@ import wnck
from view.frame.ActivitiesBox import ActivitiesBox
from view.frame.ZoomBox import ZoomBox
+from view.frame.overlaybox import OverlayBox
from view.frame.FriendsBox import FriendsBox
from view.frame.PanelWindow import PanelWindow
from view.frame.notificationtray import NotificationTray
@@ -169,10 +170,16 @@ class Frame:
tray_widget.props.widget = tray
tray_box.append(tray_widget, gtk.EXPAND)
- [x, y] = grid.point(14, 0)
+ [x, y] = grid.point(13, 0)
root.append(tray_box, hippo.PACK_FIXED)
root.move(tray_box, x, y)
+ box = OverlayBox(self._shell)
+
+ [x, y] = grid.point(14, 0)
+ root.append(box, hippo.PACK_FIXED)
+ root.move(box, x, y)
+
# Bottom panel
[menu_shell, root] = self._create_panel(grid, 0, 11, 16, 1)
menu_shell.set_position(MenuShell.TOP)
diff --git a/shell/view/frame/overlaybox.py b/shell/view/frame/overlaybox.py
new file mode 100644
index 0000000..eaa1e5d
--- /dev/null
+++ b/shell/view/frame/overlaybox.py
@@ -0,0 +1,18 @@
+import hippo
+
+from sugar.graphics import style
+from sugar.graphics.canvasicon import CanvasIcon
+
+class OverlayBox(hippo.CanvasBox):
+ def __init__(self, shell):
+ hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
+
+ self._shell = shell
+
+ icon = CanvasIcon(icon_name='stock-chat')
+ style.apply_stylesheet(icon, 'frame.OverlayIcon')
+ icon.connect('activated', self._overlay_clicked_cb)
+ self.append(icon)
+
+ def _overlay_clicked_cb(self, item):
+ self._shell.toggle_chat_visibility()
diff --git a/shell/view/stylesheet.py b/shell/view/stylesheet.py
index 22ce210..1535569 100644
--- a/shell/view/stylesheet.py
+++ b/shell/view/stylesheet.py
@@ -25,6 +25,10 @@ frame_ActivityIcon = {
'size' : style.standard_icon_size
}
+frame_OverlayIcon = {
+ 'size' : style.standard_icon_size
+}
+
frame_ZoomIcon = {
'size' : style.standard_icon_size
}