diff options
author | Pootle daemon <pootle@pootle.sugarlabs.org> | 2012-01-31 05:30:57 (GMT) |
---|---|---|
committer | Pootle daemon <pootle@pootle.sugarlabs.org> | 2012-01-31 05:30:57 (GMT) |
commit | 746395764594c7d68a8c7bd108040fdd166cbcc7 (patch) | |
tree | a40432988d87cb7b865d7ddd0be954355148d8e2 | |
parent | 2b889177c21bcf2d9d60016ebdf7b49e8bd4b898 (diff) | |
parent | 7fe18b6ad3acca38b4ace73113219a6e8e42d58f (diff) |
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
-rw-r--r-- | TurtleArt/tablock.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py index a0c0c2e..4015029 100644 --- a/TurtleArt/tablock.py +++ b/TurtleArt/tablock.py @@ -128,6 +128,7 @@ class Block: self.shapes = [None, None] self.name = name self.colors = colors + self._custom_colors = False self.scale = scale self.docks = None self.connections = None @@ -281,6 +282,11 @@ class Block: self.refresh() self.spr.inval() + def set_colors(self, colors): + self.colors = colors[:] + self._custom_colors = True + self.refresh() + def refresh(self): if self.spr is None: return @@ -487,6 +493,9 @@ class Block: self.block_methods['basic-style'](svg) def _set_colors(self, svg): + if self._custom_colors: + self.svg.set_colors(self.colors) + return if self.name in BOX_COLORS: self.colors = BOX_COLORS[self.name] elif self.name in special_block_colors: |