Fixed using the default icon when the icon isn't found
This commit is contained in:
parent
95c4534590
commit
201f1e718f
@ -76,8 +76,17 @@ class IconManager(GObject.GObject):
|
|||||||
image = Gtk.Image.new_from_pixbuf(pb)
|
image = Gtk.Image.new_from_pixbuf(pb)
|
||||||
elif canSetByName:
|
elif canSetByName:
|
||||||
image = Gtk.Image()
|
image = Gtk.Image()
|
||||||
image.set_from_icon_name(realIconName, Gtk.IconSize.DND)
|
icon_found = False
|
||||||
image.set_pixel_size(iconSize)
|
for theme in self.themes:
|
||||||
|
if theme.has_icon( realIconName ):
|
||||||
|
icon_found = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if icon_found:
|
||||||
|
image.set_from_icon_name(realIconName, Gtk.IconSize.DND)
|
||||||
|
image.set_pixel_size(iconSize)
|
||||||
|
else:
|
||||||
|
image = None
|
||||||
else:
|
else:
|
||||||
image = None
|
image = None
|
||||||
|
|
||||||
@ -178,7 +187,7 @@ class easyButton( Gtk.Button ):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
icon = iconManager.getIcon( self.iconName, iconSize )
|
icon = iconManager.getIcon( self.iconName, iconSize )
|
||||||
if not icon:
|
if icon is None:
|
||||||
icon = iconManager.getIcon( "application-default-icon", iconSize )
|
icon = iconManager.getIcon( "application-default-icon", iconSize )
|
||||||
|
|
||||||
return icon
|
return icon
|
||||||
|
Loading…
Reference in New Issue
Block a user