#5474: Scale emblems (rwh)

This commit is contained in:
Tomeu Vizoso 2008-04-03 17:31:55 +02:00
parent 905fd33810
commit 940cf6544b

View File

@ -147,10 +147,21 @@ class _IconBuffer(object):
badge_file_name = badge_info.get_filename()
if badge_file_name.endswith('.svg'):
handle = self._loader.load(badge_file_name, {}, self.cache)
dimensions = handle.get_dimension_data()
icon_width = int(dimensions[0])
icon_height = int(dimensions[1])
pixbuf = handle.get_pixbuf()
else:
pixbuf = gtk.gdk.pixbuf_new_from_file(badge_file_name)
icon_width = pixbuf.get_width()
icon_height = pixbuf.get_height()
context.scale(float(size) / icon_width,
float(size) / icon_height)
if not sensitive:
pixbuf = self._get_insensitive_pixbuf(pixbuf, widget)
surface = hippo.cairo_surface_from_gdk_pixbuf(pixbuf)