Beispiel #1
0
 def get_icon(self, icon_size):
     if self.icon_name:
         try:
             found = gnomedesktop.find_icon(icon_theme, self.icon_name, icon_size, 0)
             return icon_factory.load_icon(found, icon_size)
         except IOError:
             print " !!! Unable to load icon_name:", self.icon_name
     return LauncherItem.get_icon(self, icon_size)
Beispiel #2
0
 def load_button_icon(button, icon_name):
     try:
         import gnomedesktop
     except ImportError:
         sys.stderr.write("Could not load icon %s due to missing gnomedesktop Python module\n" % icon_name)
     else:
         icon = gnomedesktop.find_icon(gtk.icon_theme_get_default(), icon_name, 16, 0)
         if icon is not None:
             button.props.image = gobject.new(gtk.Image, file=icon, visible=True)
Beispiel #3
0
def load_icon_for_desktop_icon(icon):
    if icon != None:
        icon = gnomedesktop.find_icon(ICON_THEME, icon, deskbar.ICON_HEIGHT, 0)
        if icon != None:
            return load_icon(icon)