diff src/away.c @ 5160:91ea5ef2278b

[gaim-migrate @ 5524] 1) Added neat little protocol icons next to the set away message menu when you have more than one account signed on. I basically just copied Nathan's code, so it should be ok. 2) Changed the horizontal rules in the away message menu so they show up for me. This is how horizontal rules are done in other menus, I'm not sure why the away message menu was different. 3) Moved 2 gtkish functions from util.c to gtkutils.c. Earlier I used one of these functions, and then earlier, but not as early, I realized that gtkutils.c existed, so I put 2 and 2 together and realized you were probably flying somewhere. Well then, let's put another shrimp on the barbi'! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Apr 2003 02:28:06 +0000
parents 8e55a4d362a3
children 777f56b95a92
line wrap: on
line diff
--- a/src/away.c	Fri Apr 18 02:09:32 2003 +0000
+++ b/src/away.c	Fri Apr 18 02:28:06 2003 +0000
@@ -342,7 +342,8 @@
 	GtkWidget *remmenu;
 	GtkWidget *submenu, *submenu2;
 	GtkWidget *remitem;
-	GtkWidget *sep;
+	GtkWidget *image;
+	GdkPixbuf *pixbuf, *scale;
 	GList *l;
 	GSList *awy = away_messages;
 	struct away_message *a;
@@ -401,13 +402,7 @@
 		gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), remmenu);
 		gtk_widget_show(remmenu);
 
-		sep = gtk_hseparator_new();
-		menuitem = gtk_menu_item_new();
-		gtk_menu_shell_append(GTK_MENU_SHELL(awaymenu), menuitem);
-		gtk_container_add(GTK_CONTAINER(menuitem), sep);
-		gtk_widget_set_sensitive(menuitem, FALSE);
-		gtk_widget_show(menuitem);
-		gtk_widget_show(sep);
+		gaim_separator(awaymenu);
 
 		while (con) {
 			gc = con->data;
@@ -494,9 +489,21 @@
 					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(awaymenu), menuitem);
 				gtk_widget_show(menuitem);
 
@@ -514,13 +521,7 @@
 					g_signal_connect(GTK_OBJECT(menuitem), "activate",
 							   G_CALLBACK(set_gc_away), gc);
 
-					sep = gtk_hseparator_new();
-					menuitem = gtk_menu_item_new();
-					gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
-					gtk_container_add(GTK_CONTAINER(menuitem), sep);
-					gtk_widget_set_sensitive(menuitem, FALSE);
-					gtk_widget_show(menuitem);
-					gtk_widget_show(sep);
+					gaim_separator(submenu);
 
 					awy = away_messages;