diff gtk/gtkblist.c @ 14304:d86ad60af057

[gaim-migrate @ 16994] If an emblem is really big, scale it down to something sane. Use a really big emblem (the msn prpl icon) in yahoo. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 23 Aug 2006 04:29:16 +0000
parents 3248928fbb00
children 2620e491c8f1
line wrap: on
line diff
--- a/gtk/gtkblist.c	Wed Aug 23 04:22:04 2006 +0000
+++ b/gtk/gtkblist.c	Wed Aug 23 04:29:16 2006 +0000
@@ -3014,19 +3014,27 @@
 			g_free(filename);
 			if(emblem) {
 				if(i == 0 && size == GAIM_STATUS_ICON_SMALL) {
+					double scale_factor = 0.6;
+					if(gdk_pixbuf_get_width(emblem) > 20)
+						scale_factor = 9.0 / gdk_pixbuf_get_width(emblem);
+
 					gdk_pixbuf_composite(emblem,
 							scale, 5, 5,
 							10, 10,
 							5, 5,
-							.6, .6,
+							scale_factor, scale_factor,
 							GDK_INTERP_BILINEAR,
 							255);
 				} else {
+					double scale_factor = 1.0;
+					if(gdk_pixbuf_get_width(emblem) > 20)
+						scale_factor = 15.0 / gdk_pixbuf_get_width(emblem);
+
 					gdk_pixbuf_composite(emblem,
 							scale, emblems[i].x, emblems[i].y,
 							15, 15,
 							emblems[i].x, emblems[i].y,
-							1, 1,
+							scale_factor, scale_factor,
 							GDK_INTERP_BILINEAR,
 							255);
 				}