diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-17 11:16:48 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-17 11:16:48 (GMT) |
commit | 10f356cb22ffcaddfbbcd0b8332ef65409e5bf5f (patch) | |
tree | b8cd538af35fe70d05193b47786cce4c73a83057 /sugar | |
parent | fb829989c7c04d1d5063df3a2c64d28f1f541704 (diff) |
Add fg and bg circles, fill the paths
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/canvas/DonutItem.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sugar/canvas/DonutItem.py b/sugar/canvas/DonutItem.py index df64e85..e7f5605 100644 --- a/sugar/canvas/DonutItem.py +++ b/sugar/canvas/DonutItem.py @@ -8,6 +8,10 @@ class PieceItem(goocanvas.Path): self._angle_start = angle_start self._angle_end = angle_end + self.set_property('fill-color', '#e8e8e8') + self.set_property('stroke-color', '#d8d8d8') + self.set_property('line-width', 4) + def construct(self): r = self.get_parent().get_radius() @@ -33,6 +37,15 @@ class DonutItem(goocanvas.Group): self._radius = radius self._angle_start = 0 + bg = goocanvas.Ellipse(radius_x=radius, radius_y=radius, + fill_color='#c2c3c5', line_width=0) + self.add_child(bg) + + fg_radius = radius / 2 + fg = goocanvas.Ellipse(radius_x=fg_radius, radius_y=fg_radius, + fill_color='#d8d8d8', line_width=0) + self.add_child(fg) + def add_piece(self, perc): angle_end = self._angle_start + perc * 2 * math.pi / 100 piece_item = PieceItem(self._angle_start, angle_end) @@ -40,7 +53,7 @@ class DonutItem(goocanvas.Group): # FIXME can't override set_parent on the # PieceItem and there is no signal. - self.add_child(piece_item) + self.add_child(piece_item, 1) piece_item.construct() return piece_item |