diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-01-12 20:35:53 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-01-12 20:35:53 (GMT) |
commit | 6971ddb9a44782cd525d6a0f416bdf3cdb82d346 (patch) | |
tree | ba9b9054026271cda32f1e2570ad302a1097713e /sugar/graphics | |
parent | 55339d4bea6ac9bddfce526d9271a4a93bc844b3 (diff) |
Support for activity icons inside the bundle.
Patch by Gonzalo Odiard <godiard@gmail.com>
Modified by me to allow icon theme to override the bundle one.
Diffstat (limited to 'sugar/graphics')
-rw-r--r-- | sugar/graphics/canvasicon.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py index 125ddf9..05d3b21 100644 --- a/sugar/graphics/canvasicon.py +++ b/sugar/graphics/canvasicon.py @@ -52,7 +52,14 @@ class _IconCache: return rsvg.Handle(data=data) def get_handle(self, name, color, size): - info = self._theme.lookup_icon(name, int(size), 0) + if name[0:6] == "theme:": + icon = self._read_icon_from_name(name[6:], color, size) + else: + icon = self._read_icon(name, color) + return icon + + def _read_icon_from_name(self, name, color, size): + info = self._theme.lookup_icon(name, size, 0) if not info: raise "Icon '" + name + "' not found." |