Mercurial > pidgin
changeset 5154:48f662de029b
[gaim-migrate @ 5518]
Chip inspired me to put protocol icons in the Protocol Actions menu.
They're purdy.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 18 Apr 2003 00:18:20 +0000 |
parents | ab0f12de3718 |
children | b31ad163de3b |
files | src/prpl.c |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/prpl.c Thu Apr 17 23:44:34 2003 +0000 +++ b/src/prpl.c Fri Apr 18 00:18:20 2003 +0000 @@ -21,6 +21,7 @@ #include "gaim.h" #include "gtkutils.h" +#include "gtklist.h" #include "prpl.h" #include <sys/types.h> #include <sys/stat.h> @@ -398,14 +399,31 @@ } else { while (c) { GList *act; + GdkPixbuf *pixbuf, *scale; + GtkWidget *image; + gc = c->data; if (!gc->prpl->actions || !gc->login_time) { c = g_slist_next(c); continue; } + pixbuf = create_prpl_icon(gc->account); + if(pixbuf) { + scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, + GDK_INTERP_BILINEAR); + image = gtk_image_new_from_pixbuf(scale); + g_object_unref(G_OBJECT(pixbuf)); + g_object_unref(G_OBJECT(scale)); + } else { + image = gtk_image_new(); + } + + gtk_widget_show(image); + g_snprintf(buf, sizeof(buf), "%s (%s)", gc->username, gc->prpl->name); - menuitem = gtk_menu_item_new_with_label(buf); + menuitem = gtk_image_menu_item_new_with_label(buf); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); gtk_menu_shell_append(GTK_MENU_SHELL(protomenu), menuitem); gtk_widget_show(menuitem);