Allow passing a complete file path when creating a sugar.graphics.Icon
This commit is contained in:
parent
d988d1dfd2
commit
099cd4d1b4
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user