diff pidgin/gtkconv.c @ 18212:77b9ceb83426

Rounds icons in the infopane. Since gdk_pixbuf_animation_get_static_image seems to return pixbufs without alpha channels, this only rounds animated icons that aren't transparent.
author Sean Egan <seanegan@gmail.com>
date Wed, 20 Jun 2007 21:00:34 +0000
parents 84b577372b90
children 270e87f5cde0
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Wed Jun 20 20:14:17 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Jun 20 21:00:34 2007 +0000
@@ -2420,6 +2420,8 @@
 	/* this code is ugly, and scares me */
 	scale = gdk_pixbuf_scale_simple(buf, 32, 32,
 		GDK_INTERP_BILINEAR);
+	if (pidgin_gdk_pixbuf_is_opaque(scale))
+		pidgin_gdk_pixbuf_make_round(scale);
 
 	gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->u.im->icon), scale);
 	g_object_unref(G_OBJECT(scale));
@@ -6455,7 +6457,8 @@
 
 	scale = gdk_pixbuf_scale_simple(buf, 32, 32,
 				GDK_INTERP_BILINEAR);
-
+	if (pidgin_gdk_pixbuf_is_opaque(scale))
+		pidgin_gdk_pixbuf_make_round(scale);
 	gtkconv->u.im->icon_container = gtk_vbox_new(FALSE, 0);
 
 	event = gtk_event_box_new();
@@ -6466,8 +6469,6 @@
 
 	gtkconv->u.im->icon = gtk_image_new_from_pixbuf(scale);
 	gtkconv->auto_resize = TRUE;
-	/* Reset the size request to allow the buddy icon to resize */
-	g_idle_add(reset_auto_resize_cb, gtkconv);
 	gtk_container_add(GTK_CONTAINER(event), gtkconv->u.im->icon);
 	gtk_widget_show(gtkconv->u.im->icon);