| 4436 win->ui_data = gtkwin; |
4436 win->ui_data = gtkwin; |
| 4437 |
4437 |
| 4438 /* Create the window. */ |
4438 /* Create the window. */ |
| 4439 gtkwin->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4439 gtkwin->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
| 4440 gtk_window_set_role(GTK_WINDOW(gtkwin->window), "conversation"); |
4440 gtk_window_set_role(GTK_WINDOW(gtkwin->window), "conversation"); |
| 4441 gtk_window_set_resizable(GTK_WINDOW(gtkwin->window), TRUE); |
|
| 4442 gtk_container_set_border_width(GTK_CONTAINER(gtkwin->window), 0); |
4441 gtk_container_set_border_width(GTK_CONTAINER(gtkwin->window), 0); |
| 4443 GTK_WINDOW(gtkwin->window)->allow_shrink = TRUE; |
|
| 4444 gtk_widget_realize(gtkwin->window); |
|
| 4445 |
4442 |
| 4446 g_signal_connect(G_OBJECT(gtkwin->window), "delete_event", |
4443 g_signal_connect(G_OBJECT(gtkwin->window), "delete_event", |
| 4447 G_CALLBACK(close_win_cb), win); |
4444 G_CALLBACK(close_win_cb), win); |
| 4448 |
4445 |
| 4449 /* Create the notebook. */ |
4446 /* Create the notebook. */ |
| 4505 gaim_gtk_show(GaimConvWindow *win) |
4502 gaim_gtk_show(GaimConvWindow *win) |
| 4506 { |
4503 { |
| 4507 GaimGtkWindow *gtkwin = GAIM_GTK_WINDOW(win); |
4504 GaimGtkWindow *gtkwin = GAIM_GTK_WINDOW(win); |
| 4508 |
4505 |
| 4509 gtk_widget_show(gtkwin->window); |
4506 gtk_widget_show(gtkwin->window); |
| 4510 |
|
| 4511 #ifdef _WIN32 |
|
| 4512 /* This works around a win32 gtk+ bug, where it can't handle |
|
| 4513 * creating the button correctly before the window is shown. |
|
| 4514 * That's why we get the appearance of a button, without all |
|
| 4515 * the normal button-like properties, like being able to click |
|
| 4516 * it. ;-) --Nathan */ |
|
| 4517 if (gaim_prefs_get_bool("/gaim/gtk/conversations/close_on_tabs")) { |
|
| 4518 GaimConversation *conv; |
|
| 4519 GaimGtkConversation *gtkconv; |
|
| 4520 |
|
| 4521 conv = gaim_conv_window_get_conversation_at(win, 0); |
|
| 4522 if(conv) { |
|
| 4523 gtkconv = GAIM_GTK_CONVERSATION(conv); |
|
| 4524 gtk_widget_hide(gtkconv->close); |
|
| 4525 gtk_widget_show_all(gtkconv->close); |
|
| 4526 } |
|
| 4527 } |
|
| 4528 #endif |
|
| 4529 } |
4507 } |
| 4530 |
4508 |
| 4531 static void |
4509 static void |
| 4532 gaim_gtk_hide(GaimConvWindow *win) |
4510 gaim_gtk_hide(GaimConvWindow *win) |
| 4533 { |
4511 { |
| 4716 #if 0 |
4694 #if 0 |
| 4717 gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5); |
4695 gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5); |
| 4718 gtk_misc_set_padding(GTK_MISC(gtkconv->tab_label), 4, 0); |
4696 gtk_misc_set_padding(GTK_MISC(gtkconv->tab_label), 4, 0); |
| 4719 #endif |
4697 #endif |
| 4720 |
4698 |
| 4721 |
|
| 4722 /* Pack it all together. */ |
4699 /* Pack it all together. */ |
| 4723 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->icon, FALSE, FALSE, 0); |
4700 gtk_box_pack_start(GTK_BOX(tabby), gtkconv->icon, FALSE, FALSE, 0); |
| 4724 gtk_box_pack_start(GTK_BOX(menu_tabby), gtkconv->menu_icon, |
4701 gtk_box_pack_start(GTK_BOX(menu_tabby), gtkconv->menu_icon, |
| 4725 FALSE, FALSE, 0); |
4702 FALSE, FALSE, 0); |
| 4726 |
4703 |
| 4742 |
4719 |
| 4743 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) |
4720 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) |
| 4744 gaim_gtkconv_update_buddy_icon(conv); |
4721 gaim_gtkconv_update_buddy_icon(conv); |
| 4745 |
4722 |
| 4746 /* Add this pane to the conversation's notebook. */ |
4723 /* Add this pane to the conversation's notebook. */ |
| 4747 gtk_notebook_append_page(GTK_NOTEBOOK(gtkwin->notebook), tab_cont, tabby); |
4724 gtk_notebook_append_page_menu(GTK_NOTEBOOK(gtkwin->notebook), tab_cont, tabby, menu_tabby); |
| 4748 gtk_notebook_set_menu_label(GTK_NOTEBOOK(gtkwin->notebook), |
|
| 4749 tab_cont, menu_tabby); |
|
| 4750 |
4725 |
| 4751 gtk_widget_show(tab_cont); |
4726 gtk_widget_show(tab_cont); |
| 4752 |
4727 |
| 4753 if (gaim_conv_window_get_conversation_count(win) == 1) { |
4728 if (gaim_conv_window_get_conversation_count(win) == 1) { |
| 4754 /* Er, bug in notebooks? Switch to the page manually. */ |
4729 /* Er, bug in notebooks? Switch to the page manually. */ |