Mercurial > pidgin.yaz
changeset 3131:bb7527b5f426
[gaim-migrate @ 3146]
I molested GtkTree.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Thu, 11 Apr 2002 22:40:44 +0000 |
parents | 16c2ad1a15ce |
children | 8cb0878ef0ea |
files | ChangeLog pixmaps/Makefile.am pixmaps/arrow_down.xpm pixmaps/arrow_right.xpm src/buddy.c |
diffstat | 5 files changed, 92 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Apr 06 02:32:16 2002 +0000 +++ b/ChangeLog Thu Apr 11 22:40:44 2002 +0000 @@ -5,6 +5,7 @@ * Shell-like send history binded to Ctrl-Up and Ctrl-Down * Russian Translation Updated (thanks Grigory Bakunov) * libjabber upgraded to most recent stable version + * Buddylist looks a little better version 0.55 (03/29/2002): * Jabber improvements (Thanks Jim Seymour)
--- a/pixmaps/Makefile.am Sat Apr 06 02:32:16 2002 +0000 +++ b/pixmaps/Makefile.am Thu Apr 11 22:40:44 2002 +0000 @@ -6,6 +6,8 @@ admin_icon.xpm \ aimicon.xpm \ angel.xpm \ + arrow_down.xpm \ + arrow_right.xpm \ aol_icon.xpm \ available-away.xpm \ available-chat.xpm \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixmaps/arrow_down.xpm Thu Apr 11 22:40:44 2002 +0000 @@ -0,0 +1,12 @@ +/* XPM */ +static char * arrow_down_xpm[] = { +"11 6 3 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"...........", +" .+++++++. ", +" .+++++. ", +" .+++. ", +" .+. ", +" . "};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixmaps/arrow_right.xpm Thu Apr 11 22:40:44 2002 +0000 @@ -0,0 +1,17 @@ +/* XPM */ +static char * arrow_right_xpm[] = { +"11 11 3 1", +" c None", +". c #000000", +"+ c #FFFFFF", +" . ", +" .. ", +" .+. ", +" .++. ", +" .+++. ", +" .++++. ", +" .+++. ", +" .++. ", +" .+. ", +" .. ", +" . "};
--- a/src/buddy.c Sat Apr 06 02:32:16 2002 +0000 +++ b/src/buddy.c Thu Apr 11 22:40:44 2002 +0000 @@ -74,6 +74,9 @@ #include "pixmaps/group.xpm" #include "pixmaps/logout_menu.xpm" +#include "pixmaps/arrow_down.xpm" +#include "pixmaps/arrow_right.xpm" + static GtkTooltips *tips; static GtkAccelGroup *accel; static GtkWidget *editpane; @@ -90,6 +93,9 @@ void BuddyTickerLogonTimeout(gpointer data); void BuddyTickerLogoutTimeout(gpointer data); +typedef struct _GtkTreePixmaps GtkTreePixmaps; + + struct buddy_show { GtkWidget *item; GtkWidget *pix; @@ -1798,26 +1804,77 @@ return -1; } + + static struct group_show *new_group_show(char *group) { struct group_show *g = g_new0(struct group_show, 1); int pos = group_number(group); + GdkPixmap *pm; + GdkBitmap *bm; + GtkStyle *style; + GtkStyle *style2; + int j; g->name = g_strdup(group); g->item = gtk_tree_item_new(); - gtk_tree_insert(GTK_TREE(buddies), g->item, pos); + gtk_signal_connect(GTK_OBJECT(g->item), "button_press_event", GTK_SIGNAL_FUNC(handle_click_group), g); + + gtk_tree_insert(GTK_TREE(buddies), g->item, pos); + gtk_widget_show(g->item); g->label = gtk_label_new(group); gtk_misc_set_alignment(GTK_MISC(g->label), 0.0, 0.5); + gtk_widget_show(g->label); + gtk_container_add(GTK_CONTAINER(g->item), g->label); - gtk_widget_show(g->label); + + style = gtk_style_new(); +// style->font = gdk_font_load("-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"); + + style->fg[0].red = 104 * 255; + style->fg[0].green = 20 * 255; + style->fg[0].blue = 20* 255; + + gtk_widget_set_style(GTK_WIDGET(g->label), style); + shows = g_slist_insert(shows, g, pos); + + /* Rob does drugs - this is still evil, damn you becausse I SAID SO! */ + + pm = gdk_pixmap_create_from_xpm_d(g->item->window, + &bm, NULL, arrow_down_xpm); + + gtk_pixmap_set(GTK_PIXMAP(GTK_TREE_ITEM(g->item)->minus_pix_widget), + pm, bm); + + gdk_pixmap_unref(pm); + gdk_bitmap_unref(bm); + + pm = gdk_pixmap_create_from_xpm_d(buddies->window, + &bm, NULL, arrow_right_xpm); + + gtk_pixmap_set(GTK_PIXMAP(GTK_TREE_ITEM(g->item)->plus_pix_widget), + pm, bm); + + gdk_pixmap_unref(pm); + gdk_bitmap_unref(bm); + + style = gtk_widget_get_style(GTK_TREE_ITEM(g->item)->pixmaps_box); + style2 = gtk_widget_get_style(g->item); + style->bg[0] = style2->base[0]; + + gtk_widget_set_style(GTK_TREE_ITEM(g->item)->pixmaps_box, style); + + /* bad drugs */ + update_num_group(g); + return g; } @@ -2638,14 +2695,12 @@ notebook = gtk_notebook_new(); - - - /* Do buddy list stuff */ /* FIXME: spacing on both panes is ad hoc */ buddypane = gtk_vbox_new(FALSE, 1); buddies = gtk_tree_new(); + gtk_tree_set_view_lines(GTK_TREE(buddies), FALSE); sw = gtk_scrolled_window_new(NULL, NULL); tips = gtk_tooltips_new();