cpw.qulogic.gtk3: f89e66a5: Cairo-ify buddy list tooltips.
qulogic at pidgin.im
qulogic at pidgin.im
Sun Oct 9 04:34:58 EDT 2011
----------------------------------------------------------------------
Revision: f89e66a5722e074cb8a2fc6a66e0246c42f90755
Parent: 3a41298a3c63419a6c4262cfcc3a3ab6086da329
Author: qulogic at pidgin.im
Date: 10/09/11 01:03:55
Branch: im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/f89e66a5722e074cb8a2fc6a66e0246c42f90755
Changelog:
Cairo-ify buddy list tooltips.
Changes against parent 3a41298a3c63419a6c4262cfcc3a3ab6086da329
patched pidgin/gtkblist.c
-------------- next part --------------
============================================================
--- pidgin/gtkblist.c 361a96d3e7ac0bd8a7c3d99ccc35c44265d5c8a5
+++ pidgin/gtkblist.c 6b0c193c6dbb2689418bd6cfba4a1c8de1a951e8
@@ -2940,6 +2940,7 @@ pidgin_blist_paint_tip(GtkWidget *widget
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
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
}
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
current_height += MAX(td->name_height + td->height, td->avatar_height) + td->padding;
}
+
+ cairo_destroy(cr);
return FALSE;
}
More information about the Commits
mailing list