pidgin: 3c0721c9: Draw the user's buddy icon (in the statu...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon Jun 22 00:20:29 EDT 2009


-----------------------------------------------------------------
Revision: 3c0721c94e58fc83dff576f4577fd9ef59fce989
Ancestor: d4f448adc2a9753af706e001358285d3041fa091
Author: darkrain42 at pidgin.im
Date: 2009-06-22T04:17:03
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3c0721c94e58fc83dff576f4577fd9ef59fce989

Modified files:
        ChangeLog pidgin/gtkstatusbox.c

ChangeLog: 

Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.

I fixed the ref-counting to not leak.
Refs #8691 (waiting for the name to put in COPYRIGHT).

-------------- next part --------------
============================================================
--- ChangeLog	7a9af52839aed5eaff3b3116c78e4c059abcc1b4
+++ ChangeLog	90ae95ae12bc08952fe63a132e3d2a0ce942c750
@@ -96,6 +96,9 @@ version 2.6.0 (??/??/2009):
 	* Support for keyboard navigation on the status icon. (Li Yuan)
 	* IMG tags without 'id' attributes are turned into links to the image URL.
 	  (Dmitry Petroff)
+	* Draw the user's buddy icon at the bottom of the Buddy List with rounded
+	  corners for visual consistency with the actual icons in the Buddy List.
+	  (kostaa)
 
 	Finch:
 	* The hardware cursor is updated correctly. This will be useful
============================================================
--- pidgin/gtkstatusbox.c	0ca7c00b230a7a904aa2af77b06cf7a7463e7dcc
+++ pidgin/gtkstatusbox.c	a68b735989d6d471d3fc97befc44c26078065d28
@@ -2258,14 +2258,22 @@ pidgin_status_box_redisplay_buddy_icon(P
 
 	if (status_box->buddy_icon_img != NULL)
 	{
+		GdkPixbuf *buf, *scale;
+		int scale_width, scale_height;
 		GdkPixbufLoader *loader = gdk_pixbuf_loader_new();
 		g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL);
 		gdk_pixbuf_loader_write(loader, purple_imgstore_get_data(status_box->buddy_icon_img),
 		                        purple_imgstore_get_size(status_box->buddy_icon_img), NULL);
 		gdk_pixbuf_loader_close(loader, NULL);
-		status_box->buddy_icon = gdk_pixbuf_loader_get_pixbuf(loader);
-		if (status_box->buddy_icon)
-			g_object_ref(status_box->buddy_icon);
+		buf = gdk_pixbuf_loader_get_pixbuf(loader);
+		scale_width = gdk_pixbuf_get_width(buf);
+		scale_height = gdk_pixbuf_get_height(buf);
+		scale = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, scale_width, scale_height);
+		gdk_pixbuf_fill(scale, 0x00000000);
+		gdk_pixbuf_copy_area(buf, 0, 0, scale_width, scale_height, scale, 0, 0);
+		if (pidgin_gdk_pixbuf_is_opaque(scale))
+			pidgin_gdk_pixbuf_make_round(scale);
+		status_box->buddy_icon = scale;
 		g_object_unref(loader);
 	}
 


More information about the Commits mailing list