From: Peng Huang Date: Wed, 9 Sep 2009 06:44:31 +0000 (+0800) Subject: Use defualt icon for some engine without icon X-Git-Tag: 1.2.0.20090915~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7d9d063ec5ff9b161f13628a649f304db469364;p=platform%2Fupstream%2Fibus.git Use defualt icon for some engine without icon --- diff --git a/ui/gtk/engineabout.py b/ui/gtk/engineabout.py index 3d7df5a3..74c82e75 100644 --- a/ui/gtk/engineabout.py +++ b/ui/gtk/engineabout.py @@ -91,13 +91,12 @@ class EngineAbout(gtk.Dialog): left_margin=32) def __load_icon(self, icon): - pixbuf = gdk.pixbuf_new_from_file(icon) - w, h = pixbuf.get_width(), pixbuf.get_height() - rate = max(w, h) / float(48) - w = int(w / rate) - h = int(h / rate) - pixbuf = pixbuf.scale_simple(w, h, gdk.INTERP_BILINEAR) + try: + pixbuf = gdk.pixbuf_new_from_file_at_scale(icon, 48, 48, True) + except: + theme = gtk.icon_theme_get_default() + icon = theme.lookup_icon("ibus", 48, 0) + if icon == None: + icon = theme.lookup_icon("gtk-missing-image", 48, 0) + pixbuf = icon.load_icon() return pixbuf - - -