Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-09-19 12:04:11 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-09-19 12:04:11 (GMT)
commit9ff192d0b3ab7ed3259e1f934eb4421e3ff9032d (patch)
tree4d14ef19d61569ad446e431f61689ea84b3a319a /shell
parente8a457a2663f809e3d745bac35f718fe420e1135 (diff)
Use a different menu shell for the zoom view and the frame
Diffstat (limited to 'shell')
-rw-r--r--shell/view/BuddyIcon.py4
-rw-r--r--shell/view/frame/Frame.py6
-rw-r--r--shell/view/frame/RightPanel.py5
-rw-r--r--shell/view/frame/TopPanel.py9
-rw-r--r--shell/view/home/FriendsGroup.py5
-rw-r--r--shell/view/home/HomeWindow.py5
6 files changed, 21 insertions, 13 deletions
diff --git a/shell/view/BuddyIcon.py b/shell/view/BuddyIcon.py
index ad5fd03..0cf90fe 100644
--- a/shell/view/BuddyIcon.py
+++ b/shell/view/BuddyIcon.py
@@ -2,8 +2,8 @@ from sugar.canvas.MenuIcon import MenuIcon
from view.BuddyMenu import BuddyMenu
class BuddyIcon(MenuIcon):
- def __init__(self, shell, friend):
- MenuIcon.__init__(self, shell.get_grid(), icon_name='stock-buddy',
+ def __init__(self, shell, menu_shell, friend):
+ MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy',
color=friend.get_color(), size=96)
self._shell = shell
diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py
index d76d1ce..bd99b98 100644
--- a/shell/view/frame/Frame.py
+++ b/shell/view/frame/Frame.py
@@ -8,6 +8,7 @@ from view.frame.RightPanel import RightPanel
from view.frame.TopPanel import TopPanel
from view.frame.PanelWindow import PanelWindow
from sugar.canvas.Grid import Grid
+from sugar.canvas.MenuShell import MenuShell
class EventFrame(gobject.GObject):
__gsignals__ = {
@@ -74,6 +75,7 @@ class Frame:
root = model.get_root_item()
grid = shell.get_grid()
+ menu_shell = MenuShell(grid)
bg = goocanvas.Rect(fill_color="#4f4f4f", line_width=0)
grid.set_constraints(bg, 0, 0, 80, 60)
@@ -85,12 +87,12 @@ class Frame:
self._add_panel(model, 0, 55, 80, 5)
- panel = TopPanel(shell)
+ panel = TopPanel(shell, menu_shell)
root.add_child(panel)
self._add_panel(model, 0, 0, 80, 5)
- panel = RightPanel(shell)
+ panel = RightPanel(shell, menu_shell)
grid.set_constraints(panel, 75, 5)
root.add_child(panel)
diff --git a/shell/view/frame/RightPanel.py b/shell/view/frame/RightPanel.py
index 3cc2935..144c50e 100644
--- a/shell/view/frame/RightPanel.py
+++ b/shell/view/frame/RightPanel.py
@@ -9,9 +9,10 @@ from model.BuddyInfo import BuddyInfo
from view.frame.MenuStrategy import MenuStrategy
class RightPanel(CanvasBox):
- def __init__(self, shell):
+ def __init__(self, shell, menu_shell):
CanvasBox.__init__(self, shell.get_grid(), CanvasBox.VERTICAL, 1)
self._shell = shell
+ self._menu_shell = menu_shell
self._activity_ps = None
self._joined_hid = -1
self._left_hid = -1
@@ -24,7 +25,7 @@ class RightPanel(CanvasBox):
shell.connect('activity-changed', self.__activity_changed_cb)
def add(self, buddy):
- icon = BuddyIcon(self._shell, BuddyInfo(buddy))
+ icon = BuddyIcon(self._shell, self._menu_shell, BuddyInfo(buddy))
icon.set_menu_strategy(MenuStrategy())
self.set_constraints(icon, 3, 3)
self.add_child(icon)
diff --git a/shell/view/frame/TopPanel.py b/shell/view/frame/TopPanel.py
index 35df67f..17dd13a 100644
--- a/shell/view/frame/TopPanel.py
+++ b/shell/view/frame/TopPanel.py
@@ -22,14 +22,14 @@ class ActivityMenu(Menu):
self.add_action(icon, ActivityMenu.ACTION_CLOSE)
class ActivityIcon(MenuIcon):
- def __init__(self, shell, 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()
- MenuIcon.__init__(self, shell.get_grid(), icon_name=icon_name,
+ MenuIcon.__init__(self, menu_shell, icon_name=icon_name,
color=icon_color)
self.set_menu_strategy(MenuStrategy())
@@ -52,10 +52,11 @@ class ActivityIcon(MenuIcon):
activity.close()
class TopPanel(goocanvas.Group):
- def __init__(self, shell):
+ def __init__(self, shell, menu_shell):
goocanvas.Group.__init__(self)
self._shell = shell
+ self._menu_shell = menu_shell
self._activity_icon = None
grid = shell.get_grid()
@@ -94,7 +95,7 @@ class TopPanel(goocanvas.Group):
self._box.remove_child(self._activity_icon)
if activity:
- icon = ActivityIcon(self._shell, activity)
+ icon = ActivityIcon(self._shell, self._menu_shell, activity)
self._box.set_constraints(icon, 3, 3)
self._box.add_child(icon)
self._activity_icon = icon
diff --git a/shell/view/home/FriendsGroup.py b/shell/view/home/FriendsGroup.py
index 1749738..bac8cff 100644
--- a/shell/view/home/FriendsGroup.py
+++ b/shell/view/home/FriendsGroup.py
@@ -7,10 +7,11 @@ from view.home.MyIcon import MyIcon
from view.BuddyIcon import BuddyIcon
class FriendsGroup(goocanvas.Group):
- def __init__(self, shell):
+ def __init__(self, shell, menu_shell):
goocanvas.Group.__init__(self)
self._shell = shell
+ self._menu_shell = menu_shell
self._icon_layout = IconLayout(1200, 900)
self._friends = {}
@@ -28,7 +29,7 @@ class FriendsGroup(goocanvas.Group):
friends.connect('friend-removed', self._friend_removed_cb)
def add_friend(self, buddy_info):
- icon = BuddyIcon(self._shell, buddy_info)
+ icon = BuddyIcon(self._shell, self._menu_shell, buddy_info)
self.add_child(icon)
self._icon_layout.add_icon(icon)
diff --git a/shell/view/home/HomeWindow.py b/shell/view/home/HomeWindow.py
index ba1129e..9e2fb2a 100644
--- a/shell/view/home/HomeWindow.py
+++ b/shell/view/home/HomeWindow.py
@@ -3,6 +3,7 @@ import goocanvas
import cairo
from sugar.canvas.CanvasView import CanvasView
+from sugar.canvas.MenuShell import MenuShell
from view.home.MeshGroup import MeshGroup
from view.home.HomeGroup import HomeGroup
from view.home.FriendsGroup import FriendsGroup
@@ -23,8 +24,10 @@ class HomeWindow(gtk.Window):
self.add(self._nb)
self._nb.show()
+ menu_shell = MenuShell(shell.get_grid())
+
self._add_page(HomeGroup(shell))
- self._add_page(FriendsGroup(shell))
+ self._add_page(FriendsGroup(shell, menu_shell))
self._add_page(MeshGroup(shell))
def _add_page(self, group):