comparison pidgin/gtkblist.c @ 21945:3fc5862b834a

Use the new tooltip functions to draw the tooltips in the conversation window.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 28 Dec 2007 01:38:41 +0000
parents a368ee78a798
children d1f282dbbda1
comparison
equal deleted inserted replaced
21944:c2c66ffcdfa7 21945:3fc5862b834a
2657 2657
2658 if(gtkblist->tooltipdata == NULL) 2658 if(gtkblist->tooltipdata == NULL)
2659 return FALSE; 2659 return FALSE;
2660 2660
2661 style = gtkblist->tipwindow->style; 2661 style = gtkblist->tipwindow->style;
2662 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
2663 NULL, gtkblist->tipwindow, "tooltip", 0, 0, -1, -1);
2664 2662
2665 max_text_width = 0; 2663 max_text_width = 0;
2666 max_avatar_width = 0; 2664 max_avatar_width = 0;
2667 2665
2668 for(l = gtkblist->tooltipdata; l; l = l->next) 2666 for(l = gtkblist->tooltipdata; l; l = l->next)
2705 0, 0, max_width - TOOLTIP_BORDER - STATUS_SIZE, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); 2703 0, 0, max_width - TOOLTIP_BORDER - STATUS_SIZE, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
2706 else 2704 else
2707 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, 2705 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon,
2708 0, 0, TOOLTIP_BORDER, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); 2706 0, 0, TOOLTIP_BORDER, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
2709 } 2707 }
2708
2710 if(td->avatar) { 2709 if(td->avatar) {
2711 if (dir == GTK_TEXT_DIR_RTL) 2710 if (dir == GTK_TEXT_DIR_RTL)
2712 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 2711 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL,
2713 td->avatar, 0, 0, TOOLTIP_BORDER, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); 2712 td->avatar, 0, 0, TOOLTIP_BORDER, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
2714 else 2713 else
2715 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 2714 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL,
2716 td->avatar, 0, 0, max_width - (td->avatar_width + TOOLTIP_BORDER), 2715 td->avatar, 0, 0, max_width - (td->avatar_width + TOOLTIP_BORDER),
2717 current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); 2716 current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
2718 } 2717 }
2719 2718
2720 if (!td->avatar_is_prpl_icon) 2719 if (!td->avatar_is_prpl_icon && td->prpl_icon)
2721 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->prpl_icon, 2720 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->prpl_icon,
2722 0, 0, 2721 0, 0,
2723 prpl_col, 2722 prpl_col,
2724 current_height + ((td->name_height / 2) - (PRPL_SIZE / 2)), 2723 current_height + ((td->name_height / 2) - (PRPL_SIZE / 2)),
2725 -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); 2724 -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
2789 static gboolean 2788 static gboolean
2790 pidgin_blist_create_tooltip_for_node(GtkWidget *widget, gpointer data, int *w, int *h) 2789 pidgin_blist_create_tooltip_for_node(GtkWidget *widget, gpointer data, int *w, int *h)
2791 { 2790 {
2792 PurpleBlistNode *node = data; 2791 PurpleBlistNode *node = data;
2793 int width, height; 2792 int width, height;
2793
2794 if (gtkblist->tooltipdata) {
2795 gtkblist->tipwindow = NULL;
2796 pidgin_blist_destroy_tooltip_data();
2797 }
2794 2798
2795 gtkblist->tipwindow = widget; 2799 gtkblist->tipwindow = widget;
2796 if(PURPLE_BLIST_NODE_IS_CHAT(node) || 2800 if(PURPLE_BLIST_NODE_IS_CHAT(node) ||
2797 PURPLE_BLIST_NODE_IS_BUDDY(node) || 2801 PURPLE_BLIST_NODE_IS_BUDDY(node) ||
2798 PURPLE_BLIST_NODE_IS_GROUP(node)) { 2802 PURPLE_BLIST_NODE_IS_GROUP(node)) {