| 4406 gtkchat->list = list; |
4406 gtkchat->list = list; |
| 4407 |
4407 |
| 4408 gtk_container_add(GTK_CONTAINER(sw), list); |
4408 gtk_container_add(GTK_CONTAINER(sw), list); |
| 4409 } |
4409 } |
| 4410 |
4410 |
| |
4411 static int tooltip_timeout = 0; |
| |
4412 |
| |
4413 static gboolean |
| |
4414 pidgin_conv_tooltip_timeout(PidginConversation *gtkconv) |
| |
4415 { |
| |
4416 PurpleBlistNode *node = NULL; |
| |
4417 PurpleConversation *conv = gtkconv->active_conv; |
| |
4418 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { |
| |
4419 node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, conv->name)); |
| |
4420 } else { |
| |
4421 node = (PurpleBlistNode*)(purple_find_buddy(conv->account, conv->name)); |
| |
4422 } |
| |
4423 |
| |
4424 if (node) |
| |
4425 pidgin_blist_draw_tooltip(node, gtkconv->infopane); |
| |
4426 return FALSE; |
| |
4427 } |
| |
4428 |
| |
4429 static void |
| |
4430 pidgin_conv_leave_cb (GtkWidget *w, GdkEventCrossing *e, PidginConversation *gtkconv) |
| |
4431 { |
| |
4432 pidgin_blist_tooltip_destroy(); |
| |
4433 if (tooltip_timeout) { |
| |
4434 g_source_remove(tooltip_timeout); |
| |
4435 tooltip_timeout = 0; |
| |
4436 } |
| |
4437 } |
| |
4438 |
| |
4439 static gboolean |
| |
4440 pidgin_conv_motion_cb (GtkWidget *infopane, GdkEventMotion *event, PidginConversation *gtkconv) |
| |
4441 { |
| |
4442 int delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay"); |
| |
4443 |
| |
4444 pidgin_blist_tooltip_destroy(); |
| |
4445 if (delay == 0) |
| |
4446 return FALSE; |
| |
4447 |
| |
4448 if (tooltip_timeout != 0) |
| |
4449 g_source_remove(tooltip_timeout); |
| |
4450 |
| |
4451 tooltip_timeout = g_timeout_add(delay, (GSourceFunc)pidgin_conv_tooltip_timeout, gtkconv); |
| |
4452 return FALSE; |
| |
4453 } |
| |
4454 |
| 4411 static GtkWidget * |
4455 static GtkWidget * |
| 4412 setup_common_pane(PidginConversation *gtkconv) |
4456 setup_common_pane(PidginConversation *gtkconv) |
| 4413 { |
4457 { |
| 4414 GtkWidget *paned, *vbox, *frame, *imhtml_sw, *event_box; |
4458 GtkWidget *paned, *vbox, *frame, *imhtml_sw, *event_box; |
| 4415 GtkCellRenderer *rend; |
4459 GtkCellRenderer *rend; |
| 4435 gtkconv->infopane_hbox = gtk_hbox_new(FALSE, 0); |
4479 gtkconv->infopane_hbox = gtk_hbox_new(FALSE, 0); |
| 4436 gtk_box_pack_start(GTK_BOX(vbox), event_box, FALSE, FALSE, 0); |
4480 gtk_box_pack_start(GTK_BOX(vbox), event_box, FALSE, FALSE, 0); |
| 4437 gtk_container_add(GTK_CONTAINER(event_box), gtkconv->infopane_hbox); |
4481 gtk_container_add(GTK_CONTAINER(event_box), gtkconv->infopane_hbox); |
| 4438 gtk_widget_show(gtkconv->infopane_hbox); |
4482 gtk_widget_show(gtkconv->infopane_hbox); |
| 4439 gtk_widget_add_events(event_box, |
4483 gtk_widget_add_events(event_box, |
| 4440 GDK_BUTTON1_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); |
4484 GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); |
| 4441 g_signal_connect(G_OBJECT(event_box), "button_press_event", |
4485 g_signal_connect(G_OBJECT(event_box), "button_press_event", |
| 4442 G_CALLBACK(infopane_press_cb), gtkconv); |
4486 G_CALLBACK(infopane_press_cb), gtkconv); |
| |
4487 |
| |
4488 g_signal_connect(G_OBJECT(event_box), "motion-notify-event", |
| |
4489 G_CALLBACK(pidgin_conv_motion_cb), gtkconv); |
| |
4490 g_signal_connect(G_OBJECT(event_box), "leave-notify-event", |
| |
4491 G_CALLBACK(pidgin_conv_leave_cb), gtkconv); |
| 4443 |
4492 |
| 4444 |
4493 |
| 4445 gtkconv->infopane = gtk_cell_view_new(); |
4494 gtkconv->infopane = gtk_cell_view_new(); |
| 4446 gtkconv->infopane_model = gtk_list_store_new(CONV_NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, GDK_TYPE_PIXBUF); |
4495 gtkconv->infopane_model = gtk_list_store_new(CONV_NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, GDK_TYPE_PIXBUF); |
| 4447 gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), |
4496 gtk_cell_view_set_model(GTK_CELL_VIEW(gtkconv->infopane), |
| 7658 */ |
7707 */ |
| 7659 |
7708 |
| 7660 static gboolean |
7709 static gboolean |
| 7661 infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *gtkconv) |
7710 infopane_press_cb(GtkWidget *widget, GdkEventButton *e, PidginConversation *gtkconv) |
| 7662 { |
7711 { |
| 7663 int nb_x, nb_y; |
|
| 7664 |
|
| 7665 if (e->type != GDK_BUTTON_PRESS) |
7712 if (e->type != GDK_BUTTON_PRESS) |
| 7666 return FALSE; |
7713 return FALSE; |
| 7667 |
7714 |
| 7668 if (e->button == 3) { |
7715 if (e->button == 3) { |
| 7669 /* Right click was pressed. Popup the Send To menu. */ |
7716 /* Right click was pressed. Popup the Send To menu. */ |
| 7690 } |
7737 } |
| 7691 |
7738 |
| 7692 gtk_widget_show_all(menu); |
7739 gtk_widget_show_all(menu); |
| 7693 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, e->button, e->time); |
7740 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, e->button, e->time); |
| 7694 return TRUE; |
7741 return TRUE; |
| 7695 } else if (e->button != 1) { |
7742 } |
| 7696 return FALSE; |
|
| 7697 } |
|
| 7698 |
|
| 7699 if (gtkconv->win->in_drag) { |
|
| 7700 purple_debug(PURPLE_DEBUG_WARNING, "gtkconv", |
|
| 7701 "Already in the middle of a window drag at tab_press_cb\n"); |
|
| 7702 return TRUE; |
|
| 7703 } |
|
| 7704 |
|
| 7705 gtkconv->win->in_predrag = TRUE; |
|
| 7706 gtkconv->win->drag_tab = gtk_notebook_page_num(GTK_NOTEBOOK(gtkconv->win->notebook), gtkconv->tab_cont); |
|
| 7707 |
|
| 7708 gdk_window_get_origin(gtkconv->infopane_hbox->window, &nb_x, &nb_y); |
|
| 7709 |
|
| 7710 gtkconv->win->drag_min_x = gtkconv->infopane_hbox->allocation.x + nb_x; |
|
| 7711 gtkconv->win->drag_min_y = gtkconv->infopane_hbox->allocation.y + nb_y; |
|
| 7712 gtkconv->win->drag_max_x = gtkconv->infopane_hbox->allocation.width + gtkconv->win->drag_min_x; |
|
| 7713 gtkconv->win->drag_max_y = gtkconv->infopane_hbox->allocation.height + gtkconv->win->drag_min_y; |
|
| 7714 |
|
| 7715 /* Connect the new motion signals. */ |
|
| 7716 gtkconv->win->drag_motion_signal = |
|
| 7717 g_signal_connect(G_OBJECT(gtkconv->win->notebook), "motion_notify_event", |
|
| 7718 G_CALLBACK(notebook_motion_cb), gtkconv->win); |
|
| 7719 |
|
| 7720 gtkconv->win->drag_leave_signal = |
|
| 7721 g_signal_connect(G_OBJECT(gtkconv->win->notebook), "leave_notify_event", |
|
| 7722 G_CALLBACK(notebook_leave_cb), gtkconv->win); |
|
| 7723 |
|
| 7724 return FALSE; |
7743 return FALSE; |
| 7725 |
7744 } |
| 7726 } |
7745 |
| 7727 |
|
| 7728 static gboolean |
7746 static gboolean |
| 7729 notebook_press_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) |
7747 notebook_press_cb(GtkWidget *widget, GdkEventButton *e, PidginWindow *win) |
| 7730 { |
7748 { |
| 7731 gint nb_x, nb_y, x_rel, y_rel; |
7749 gint nb_x, nb_y, x_rel, y_rel; |
| 7732 int tab_clicked; |
7750 int tab_clicked; |