Mercurial > pidgin
changeset 16095:80adc614a9e5
merge of '68afd9ff77d030e589ee7972830cf2a91916240f'
and '9aef6467b816a8a5e600be2bfb75f15eb10f7d4a'
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 14 Apr 2007 02:19:49 +0000 |
parents | 2d9045592ed3 (diff) a4644c26cd85 (current diff) |
children | 770e2f91d8f1 634b96915d2e |
files | |
diffstat | 1 files changed, 48 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Sat Apr 14 00:04:49 2007 +0000 +++ b/pidgin/gtkblist.c Sat Apr 14 02:19:49 2007 +0000 @@ -2050,6 +2050,51 @@ } } +static void +roundify(GdkPixbuf *pixbuf) { + int width, height, rowstride; + guchar *pixels; + + if (!gdk_pixbuf_get_has_alpha(pixbuf)) + return; + + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + rowstride = gdk_pixbuf_get_rowstride(pixbuf); + pixels = gdk_pixbuf_get_pixels(pixbuf); + + if (width < 6 || height < 6) + return; + + /* Top left */ + pixels[3] = 0; + pixels[7] = 0x80; + pixels[11] = 0xC0; + pixels[rowstride + 3] = 0x80; + pixels[rowstride * 2 + 3] = 0xC0; + + /* Top right */ + pixels[width * 4 - 1] = 0; + pixels[width * 4 - 5] = 0x80; + pixels[width * 4 - 9] = 0xC0; + pixels[rowstride + (width * 4) - 1] = 0x80; + pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; + + /* Bottom left */ + pixels[(height - 1) * rowstride + 3] = 0; + pixels[(height - 1) * rowstride + 7] = 0x80; + pixels[(height - 1) * rowstride + 11] = 0xC0; + pixels[(height - 2) * rowstride + 3] = 0x80; + pixels[(height - 3) * rowstride + 3] = 0xC0; + + /* Bottom right */ + pixels[height * rowstride - 1] = 0; + pixels[(height - 1) * rowstride - 1] = 0x80; + pixels[(height - 2) * rowstride - 1] = 0xC0; + pixels[height * rowstride - 5] = 0x80; + pixels[height * rowstride - 9] = 0xC0; +} + /* Altered from do_colorshift in gnome-panel */ static void do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift) @@ -2196,6 +2241,8 @@ ret = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); gdk_pixbuf_fill(ret, 0x00000000); gdk_pixbuf_scale(buf, ret, (32-scale_width)/2, (32-scale_height)/2, scale_width, scale_height, (32-scale_width)/2, (32-scale_height)/2, (double)scale_width/(double)orig_width, (double)scale_height/(double)orig_height, GDK_INTERP_BILINEAR); + if (pidgin_gdk_pixbuf_is_opaque(ret)) + roundify(ret); } else { ret = gdk_pixbuf_scale_simple(buf,scale_width,scale_height, GDK_INTERP_BILINEAR); } @@ -4369,7 +4416,7 @@ NULL); rend = gtk_cell_renderer_pixbuf_new(); - g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, NULL); + g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL); gtk_tree_view_column_pack_start(column, rend, FALSE); gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN, #if GTK_CHECK_VERSION(2,6,0)