~joel-auterson/ubuntu/maverick/ibus/newmenuname

« back to all changes in this revision

Viewing changes to setup/engineabout.py

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-10-05 20:45:18 UTC
  • mfrom: (1.1.5 upstream) (6.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20091005204518-069vlwrl3r8v7bbr
Tags: 1.2.0.20090927-2
* create po template when build (LP: #188690)
  - debian/rules: updated.
  - debian/clean: remove pot file when clean.
* debian/control: build depends on python-rsvg (LP: #432375)

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
                        left_margin=32)
92
92
 
93
93
    def __load_icon(self, icon):
94
 
        pixbuf = gdk.pixbuf_new_from_file(icon)
95
 
        w, h = pixbuf.get_width(), pixbuf.get_height()
96
 
        rate = max(w, h) / float(48)
97
 
        w = int(w / rate)
98
 
        h = int(h / rate)
99
 
        pixbuf = pixbuf.scale_simple(w, h, gdk.INTERP_BILINEAR)
 
94
        try:
 
95
            pixbuf = gdk.pixbuf_new_from_file_at_scale(icon, 48, 48, True)
 
96
        except:
 
97
            theme = gtk.icon_theme_get_default()
 
98
            icon = theme.lookup_icon("ibus", 48, 0)
 
99
            if icon == None:
 
100
                icon = theme.lookup_icon("gtk-missing-image", 48, 0)
 
101
            pixbuf = icon.load_icon()
100
102
        return pixbuf
101
 
 
102
 
 
103