Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/home/HomeView.py
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-08-23 11:09:10 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-08-23 11:09:10 (GMT)
commitf3435bb9148bf5d7fe91c6fef591b5e9156e9a41 (patch)
tree2cc1390d16cbe9886da08812940d36a39c50717c /shell/home/HomeView.py
parent1b688469c1861f0f47729393d7649d38b100fc61 (diff)
Add simple theme support to pick up color themes in the Home Window
Diffstat (limited to 'shell/home/HomeView.py')
-rw-r--r--shell/home/HomeView.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/shell/home/HomeView.py b/shell/home/HomeView.py
index 9cc01ac..d7a7be9 100644
--- a/shell/home/HomeView.py
+++ b/shell/home/HomeView.py
@@ -8,6 +8,8 @@ from sugar.canvas.DonutItem import DonutItem
from sugar.canvas.DonutItem import PieceItem
from sugar.canvas.DonutItem import PieceIcon
+from Theme import Theme
+
class TasksItem(DonutItem):
def __init__(self, shell):
DonutItem.__init__(self, 250)
@@ -41,16 +43,31 @@ class TasksItem(DonutItem):
class Background(goocanvas.Group):
def __init__(self):
goocanvas.Group.__init__(self)
+ self._theme = Theme()
+ self._theme.connect("theme-changed", self.__theme_changed_cb)
- item = goocanvas.Rect(width=1200, height=900,
- fill_color="#d8d8d8")
- self.add_child(item)
+ color = self._theme.get_home_colors()[1]
+ self._outer_rect = goocanvas.Rect(width=1200, height=900,
+ fill_color=color)
+ self.add_child(self._outer_rect)
+
+ color = self._theme.get_home_colors()[0]
+ self._inner_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)
item = goocanvas.Text(text="My Activities",
x=12, y=12, fill_color="black",
font="Sans 21")
self.add_child(item)
+ def __theme_changed_cb(self, theme, colors):
+ color = self._theme.get_home_colors()[0]
+ self._inner_rect.set_property("fill-color", color)
+ color = self._theme.get_home_colors()[1]
+ self._outer_rect.set_property("fill-color", color)
+
class Model(goocanvas.CanvasModelSimple):
def __init__(self, shell):
goocanvas.CanvasModelSimple.__init__(self)