Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-08-28 12:58:21 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-08-28 12:58:21 (GMT)
commit8d26a76a88551cf83b8b12ca9d3db696e1c71f7d (patch)
tree372f057263f64a8c61489d7e44439104e57db068
parentb6cf5ef31e30e23cb608fbc803af3026a5bb6e0b (diff)
Add the actions buttons on the friends panel
-rw-r--r--shell/panel/FriendsPanel.py45
-rw-r--r--shell/panel/Panel.py4
2 files changed, 49 insertions, 0 deletions
diff --git a/shell/panel/FriendsPanel.py b/shell/panel/FriendsPanel.py
index 5d14893..d0556f5 100644
--- a/shell/panel/FriendsPanel.py
+++ b/shell/panel/FriendsPanel.py
@@ -1,5 +1,50 @@
+import goocanvas
+
from panel.Panel import Panel
+from sugar.canvas.IconItem import IconItem
+
+class ActionsBar(goocanvas.Group):
+ def __init__(self, shell, width):
+ goocanvas.Group.__init__(self)
+ self._width = width
+ self._shell = shell
+
+ self._y = 0
+
+ icon = IconItem(icon_name='stock-share', size=self._width)
+ icon.connect('clicked', self.__share_clicked_cb)
+ self.add_icon(icon)
+
+ icon = IconItem(icon_name='stock-invite', size=self._width)
+ icon.connect('clicked', self.__invite_clicked_cb)
+ self.add_icon(icon)
+
+ icon = IconItem(icon_name='stock-chat', size=self._width)
+ icon.connect('clicked', self.__chat_clicked_cb)
+ self.add_icon(icon)
+
+ def add_icon(self, icon):
+ self._y += (self._width + 6)
+ icon.set_property('y', self._y)
+ self.add_child(icon)
+
+ def __share_clicked_cb(self, item):
+ pass
+
+ def __invite_clicked_cb(self, item):
+ pass
+
+ def __chat_clicked_cb(self, item):
+ pass
class FriendsPanel(Panel):
def __init__(self, shell):
Panel.__init__(self)
+ self._shell = shell
+
+ def construct(self):
+ Panel.construct(self)
+
+ actions_bar = ActionsBar(self._shell, self.get_width())
+ actions_bar.translate(self.get_border(), self.get_border())
+ self.get_root().add_child(actions_bar)
diff --git a/shell/panel/Panel.py b/shell/panel/Panel.py
index c7347f1..da77bf9 100644
--- a/shell/panel/Panel.py
+++ b/shell/panel/Panel.py
@@ -45,6 +45,10 @@ class Panel(gtk.Window):
height = self._view.get_allocation().height
return height - self.get_border() * 2
+ def get_width(self):
+ width = self._view.get_allocation().width
+ return width - self.get_border() * 2
+
def __realize_cb(self, window):
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)