Mercurial > pidgin
changeset 3866:994b5c4d15dd
[gaim-migrate @ 4018]
leave me alone
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sun, 03 Nov 2002 07:32:07 +0000 |
parents | 66b8dcba9751 |
children | 43e396e94095 |
files | src/buddy_chat.c src/conversation.c src/ui.h |
diffstat | 3 files changed, 41 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy_chat.c Sun Nov 03 01:19:45 2002 +0000 +++ b/src/buddy_chat.c Sun Nov 03 07:32:07 2002 +0000 @@ -1190,6 +1190,7 @@ GtkWidget *list; GtkCellRenderer *rend; GtkTreeViewColumn *col; + GtkWidget *tabby; char buf[BUF_LONG]; @@ -1246,7 +1247,19 @@ cont = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(cont), 5); - gtk_notebook_append_page(GTK_NOTEBOOK(chat_notebook), cont, gtk_label_new(b->name)); + + tabby = gtk_hbox_new(FALSE, 0); + b->close = gtk_button_new(); + gtk_container_add(GTK_CONTAINER(b->close), gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU)); + gtk_button_set_relief(GTK_BUTTON(b->close), GTK_RELIEF_NONE); + b->tab_label = gtk_label_new(b->name); + + gtk_signal_connect(GTK_OBJECT(b->close), "clicked", GTK_SIGNAL_FUNC(close_callback), b); + + gtk_box_pack_start(GTK_BOX(tabby), b->close, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tabby), b->tab_label, FALSE, FALSE, 0); + gtk_widget_show_all(tabby); + gtk_notebook_append_page(GTK_NOTEBOOK(chat_notebook), cont, tabby); gtk_widget_show(cont); } else { win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
--- a/src/conversation.c Sun Nov 03 01:19:45 2002 +0000 +++ b/src/conversation.c Sun Nov 03 07:32:07 2002 +0000 @@ -2562,8 +2562,7 @@ void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data) { - GtkWidget *label = gtk_notebook_get_tab_label(notebook, - gtk_notebook_get_nth_page(notebook, page_num)); + GtkWidget *label = NULL; GtkStyle *style; struct conversation *c; @@ -2581,6 +2580,12 @@ c = g_list_nth_data(chats, page_num); if (c && c->window && c->entry) gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); + + label = c->tab_label; + + if (!label) + return; + if (!GTK_WIDGET_REALIZED(label)) return; style = gtk_style_new(); @@ -2626,9 +2631,7 @@ (im_options & OPT_IM_ONE_WINDOW) && c->is_chat) ? g_list_length(conversations) : 0; GList *ws = (c->is_chat ? chats : conversations); - GtkWidget *label = gtk_notebook_get_tab_label(notebook, - gtk_notebook_get_nth_page(notebook, - offs + g_list_index(ws, c))); + GtkWidget *label = c->tab_label; style = gtk_style_new(); if (!GTK_WIDGET_REALIZED(label)) gtk_widget_realize(label); @@ -2722,6 +2725,7 @@ GtkWidget *hbox; GtkWidget *label; GtkWidget *menubar; + GtkWidget *tabby; c->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); @@ -2794,7 +2798,19 @@ cont = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(cont), 5); /* this doesn't matter since we're resetting the name once we're out of the if */ - gtk_notebook_insert_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name), +/* gtk_notebook_insert_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name),*/ + tabby = gtk_hbox_new(FALSE, 0); + c->close = gtk_button_new(); + gtk_container_add(GTK_CONTAINER(c->close), gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU)); + gtk_button_set_relief(GTK_BUTTON(c->close), GTK_RELIEF_NONE); + c->tab_label = gtk_label_new(c->name); + + gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback), c); + + gtk_box_pack_start(GTK_BOX(tabby), c->close, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(tabby), c->tab_label, FALSE, FALSE, 0); + gtk_widget_show_all(tabby); + gtk_notebook_insert_page(GTK_NOTEBOOK(convo_notebook), cont, tabby, g_list_index(conversations, c)); gtk_widget_show(cont); } else { @@ -3255,7 +3271,7 @@ if (im_options & OPT_IM_ONE_WINDOW) { nb = GTK_NOTEBOOK(convo_notebook); index = g_list_index(conversations, c); - gtk_notebook_set_tab_label_text(nb, gtk_notebook_get_nth_page(nb, index), text); + gtk_label_set_text(GTK_LABEL(c->tab_label), text); } else { char buf[256]; if ((find_log_info(c->name)) || (c->is_chat && (logging_options & OPT_LOG_CHATS))
--- a/src/ui.h Sun Nov 03 01:19:45 2002 +0000 +++ b/src/ui.h Sun Nov 03 07:32:07 2002 +0000 @@ -167,9 +167,9 @@ int id; GtkWidget *count; GtkWidget *list; - GtkWidget *whisper; + GtkWidget *whisper; GtkWidget *invite; - GtkWidget *close; + GtkWidget *close; GtkWidget *topic_text; /* something to distinguish */ @@ -184,6 +184,8 @@ GtkTextBuffer *entry_buffer; GtkWidget *entry; + + GtkWidget *tab_label; }; struct log_conversation {