Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-28 18:56:02 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-28 18:56:02 (GMT)
commit099cd4d1b4d095e6f1c5b142a877a0a8cbe82f8b (patch)
treeca8a2770a518f297486b92db214daff07b214e51 /sugar
parentd988d1dfd26a122f256f59d93860d1aa40ce8133 (diff)
Allow passing a complete file path when creating a sugar.graphics.Icon
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/icon.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sugar/graphics/icon.py b/sugar/graphics/icon.py
index 03b1927..c4c9d80 100644
--- a/sugar/graphics/icon.py
+++ b/sugar/graphics/icon.py
@@ -15,6 +15,8 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import os
+
import gtk
class Icon(gtk.Image):
@@ -29,6 +31,10 @@ class Icon(gtk.Image):
source = gtk.IconSource()
source.set_icon_name(normal_name)
icon_set.add_source(source)
+ elif os.path.exists(normal_name):
+ source = gtk.IconSource()
+ source.set_filename(normal_name)
+ icon_set.add_source(source)
inactive_name = name + '-inactive'
if icon_theme.has_icon(inactive_name):