Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/home
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-08-23 12:06:45 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-08-23 12:06:45 (GMT)
commit3b9d3daa3baf991f071438e21e07f2e8a4834e72 (patch)
tree6f4d4b3378c4cdb4b830adfc074c761e7fd9d2ea /shell/home
parentf3435bb9148bf5d7fe91c6fef591b5e9156e9a41 (diff)
Implent color theming for Friends view
Diffstat (limited to 'shell/home')
-rw-r--r--shell/home/FriendsView.py31
-rw-r--r--shell/home/HomeView.py12
2 files changed, 34 insertions, 9 deletions
diff --git a/shell/home/FriendsView.py b/shell/home/FriendsView.py
index 820b555..dfa55af 100644
--- a/shell/home/FriendsView.py
+++ b/shell/home/FriendsView.py
@@ -5,21 +5,46 @@ import goocanvas
from sugar.canvas.IconItem import IconItem
from sugar.canvas.IconItem import IconColor
+from Theme import Theme
+
class Model(goocanvas.CanvasModelSimple):
def __init__(self, data_model):
goocanvas.CanvasModelSimple.__init__(self)
+ self._theme = Theme()
+ self._theme.connect("theme-changed", self.__theme_changed_cb)
root = self.get_root_item()
- item = goocanvas.Rect(width=1200, height=900,
- fill_color="#d8d8d8")
- root.add_child(item)
+ color = self._theme.get_home_colors()[2]
+ self._mesh_rect = goocanvas.Rect(width=1200, height=900,
+ fill_color=color)
+ root.add_child(self._mesh_rect)
+
+ color = self._theme.get_home_colors()[1]
+ self._friends_rect = goocanvas.Rect(x=100, y=100, width=1000, height=700,
+ line_width=0, fill_color=color,
+ radius_x=30, radius_y=30)
+ root.add_child(self._friends_rect)
+
+ color = self._theme.get_home_colors()[0]
+ self._home_rect = goocanvas.Rect(x=400, y=300, width=400, height=300,
+ line_width=0, fill_color=color,
+ radius_x=30, radius_y=30)
+ root.add_child(self._home_rect)
for friend in data_model:
self.add_friend(friend)
data_model.connect('friend-added', self.__friend_added_cb)
+ def __theme_changed_cb(self, theme, colors):
+ color = self._theme.get_home_colors()[0]
+ self._home_rect.set_property("fill-color", color)
+ color = self._theme.get_home_colors()[1]
+ self._friends_rect.set_property("fill-color", color)
+ color = self._theme.get_home_colors()[2]
+ self._mesh_rect.set_property("fill-color", color)
+
def add_friend(self, friend):
root = self.get_root_item()
diff --git a/shell/home/HomeView.py b/shell/home/HomeView.py
index d7a7be9..08707e3 100644
--- a/shell/home/HomeView.py
+++ b/shell/home/HomeView.py
@@ -47,15 +47,15 @@ class Background(goocanvas.Group):
self._theme.connect("theme-changed", self.__theme_changed_cb)
color = self._theme.get_home_colors()[1]
- self._outer_rect = goocanvas.Rect(width=1200, height=900,
+ self._friends_rect = goocanvas.Rect(width=1200, height=900,
fill_color=color)
- self.add_child(self._outer_rect)
+ self.add_child(self._friends_rect)
color = self._theme.get_home_colors()[0]
- self._inner_rect = goocanvas.Rect(x=100, y=100, width=1000, height=700,
+ self._home_rect = goocanvas.Rect(x=100, y=100, width=1000, height=700,
line_width=0, fill_color=color,
radius_x=30, radius_y=30)
- self.add_child(self._inner_rect)
+ self.add_child(self._home_rect)
item = goocanvas.Text(text="My Activities",
x=12, y=12, fill_color="black",
@@ -64,9 +64,9 @@ class Background(goocanvas.Group):
def __theme_changed_cb(self, theme, colors):
color = self._theme.get_home_colors()[0]
- self._inner_rect.set_property("fill-color", color)
+ self._home_rect.set_property("fill-color", color)
color = self._theme.get_home_colors()[1]
- self._outer_rect.set_property("fill-color", color)
+ self._friends_rect.set_property("fill-color", color)
class Model(goocanvas.CanvasModelSimple):
def __init__(self, shell):