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:04:51 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-08-28 12:04:51 (GMT)
commita0127aa4df05dfac0c99019f1fdfa89f587b4932 (patch)
treee38207f849a7b63ff42b0afd14da76f031338c1f
parent766f9d6e6883822a4b3f76c73e7d7d5e124fb51e (diff)
Add the top panel, unfinished.
-rw-r--r--shell/panel/Panel.py3
-rw-r--r--shell/panel/PanelManager.py9
-rw-r--r--shell/panel/TopPanel.py35
-rw-r--r--shell/panel/VerbsPanel.py2
4 files changed, 44 insertions, 5 deletions
diff --git a/shell/panel/Panel.py b/shell/panel/Panel.py
index 7c3798b..c7347f1 100644
--- a/shell/panel/Panel.py
+++ b/shell/panel/Panel.py
@@ -35,6 +35,9 @@ class Panel(gtk.Window):
def get_model(self):
return self._view.get_model()
+ def get_root(self):
+ return self.get_model().get_root_item()
+
def get_border(self):
return PanelModel.BORDER
diff --git a/shell/panel/PanelManager.py b/shell/panel/PanelManager.py
index 998ba72..04ffadc 100644
--- a/shell/panel/PanelManager.py
+++ b/shell/panel/PanelManager.py
@@ -2,6 +2,7 @@ import gtk
from panel.VerbsPanel import VerbsPanel
from panel.FriendsPanel import FriendsPanel
+from panel.TopPanel import TopPanel
from panel.Panel import Panel
class PanelManager:
@@ -18,10 +19,10 @@ class PanelManager:
self._friends_panel.resize(size, gtk.gdk.screen_height())
self._friends_panel.show()
- panel = Panel()
- panel.move(0, 0)
- panel.resize(gtk.gdk.screen_width(), size)
- panel.show()
+ self._top_panel = TopPanel(shell)
+ self._top_panel.move(0, 0)
+ self._top_panel.resize(gtk.gdk.screen_width(), size)
+ self._top_panel.show()
panel = Panel()
panel.move(0, 0)
diff --git a/shell/panel/TopPanel.py b/shell/panel/TopPanel.py
new file mode 100644
index 0000000..58e12f6
--- /dev/null
+++ b/shell/panel/TopPanel.py
@@ -0,0 +1,35 @@
+import goocanvas
+
+from panel.Panel import Panel
+from sugar.canvas.IconItem import IconItem
+
+class ZoomBar(goocanvas.Group):
+ def __init__(self, height):
+ goocanvas.Group.__init__(self)
+ self._height = height
+
+ self.add_zoom_level('stock-zoom-activity')
+ self.add_zoom_level('stock-zoom-home')
+ self.add_zoom_level('stock-zoom-friends')
+ self.add_zoom_level('stock-zoom-mesh')
+
+ def add_zoom_level(self, icon_name):
+ icon = IconItem(icon_name=icon_name, size=self._height)
+
+ icon_size = self._height
+ x = (icon_size + 6) * self.get_n_children()
+ icon.set_property('x', x)
+
+ self.add_child(icon)
+
+class TopPanel(Panel):
+ def __init__(self, shell):
+ Panel.__init__(self)
+ self._shell = shell
+
+ def construct(self):
+ Panel.construct(self)
+
+ zoom_bar = ZoomBar(self.get_height())
+ zoom_bar.translate(self.get_border(), self.get_border())
+ self.get_root().add_child(zoom_bar)
diff --git a/shell/panel/VerbsPanel.py b/shell/panel/VerbsPanel.py
index ed4beb1..43c0755 100644
--- a/shell/panel/VerbsPanel.py
+++ b/shell/panel/VerbsPanel.py
@@ -12,7 +12,7 @@ class ActivityItem(IconItem):
icon_name = activity.get_icon()
if not icon_name:
act_type = activity.get_default_type()
- raise RuntimeError("Actvity %s did not have an icon!" % act_type)
+ raise RuntimeError("Activity %s did not have an icon!" % act_type)
IconItem.__init__(self, icon_name=icon_name,
color=IconColor('white'), size=size)
self._activity = activity