diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2011-10-09 05:03:55 +0000 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2011-10-09 05:03:55 +0000 |
commit | 614c5c6cc74af2dd09928a51cc675bfb3eba4312 (patch) | |
tree | b031b7c118c7944f4865d87e5ba83369460f0f39 | |
parent | f00ce77a54bfc3a88a68932180b4c57fc42427b8 (diff) | |
download | pidgin-614c5c6cc74af2dd09928a51cc675bfb3eba4312.tar.gz |
Cairo-ify buddy list tooltips.
-rw-r--r-- | pidgin/gtkblist.c | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 233dec9888..75fc7f27da 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -2940,6 +2940,7 @@ static gboolean pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) { GtkStyle *style; + cairo_t *cr; int current_height, max_width; int max_text_width; int max_avatar_width; @@ -2973,6 +2974,7 @@ pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) else prpl_col = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width - PRPL_SIZE; + cr = gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(gtkblist->tipwindow))); current_height = 12; for(l = gtkblist->tooltipdata; l; l = l->next) { @@ -2992,30 +2994,37 @@ pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) } if (td->status_icon) { - if (dir == GTK_TEXT_DIR_RTL) - gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, - 0, 0, max_width - TOOLTIP_BORDER - status_size, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); - else - gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, - 0, 0, TOOLTIP_BORDER, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); + if (dir == GTK_TEXT_DIR_RTL) { + gdk_cairo_set_source_pixbuf(cr, td->status_icon, + max_width - TOOLTIP_BORDER - status_size, + current_height); + cairo_paint(cr); + } else { + gdk_cairo_set_source_pixbuf(cr, td->status_icon, + TOOLTIP_BORDER, current_height); + cairo_paint(cr); + } } if(td->avatar) { - if (dir == GTK_TEXT_DIR_RTL) - gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, - td->avatar, 0, 0, TOOLTIP_BORDER, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); - else - gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, - td->avatar, 0, 0, max_width - (td->avatar_width + TOOLTIP_BORDER), - current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); + if (dir == GTK_TEXT_DIR_RTL) { + gdk_cairo_set_source_pixbuf(cr, td->avatar, + TOOLTIP_BORDER, current_height); + cairo_paint(cr); + } else { + gdk_cairo_set_source_pixbuf(cr, td->avatar, + max_width - (td->avatar_width + TOOLTIP_BORDER), + current_height); + cairo_paint(cr); + } } - if (!td->avatar_is_prpl_icon && td->prpl_icon) - gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->prpl_icon, - 0, 0, - prpl_col, - current_height + ((td->name_height / 2) - (PRPL_SIZE / 2)), - -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); + if (!td->avatar_is_prpl_icon && td->prpl_icon) { + gdk_cairo_set_source_pixbuf(cr, td->prpl_icon, prpl_col, + current_height + + (td->name_height - PRPL_SIZE) / 2); + cairo_paint(cr); + } if (td->name_layout) { if (dir == GTK_TEXT_DIR_RTL) { @@ -3046,6 +3055,8 @@ pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) current_height += MAX(td->name_height + td->height, td->avatar_height) + td->padding; } + + cairo_destroy(cr); return FALSE; } |