pidgin/gtkroomlist.c

branch
cpw.qulogic.gtk3
changeset 32394
f883709bdba4
parent 30706
612b36b49058
child 32410
3d78feb90b9c
equal deleted inserted replaced
32393:69f260ac8ea8 32394:f883709bdba4
357 PidginRoomlist *grl = list->ui_data; 357 PidginRoomlist *grl = list->ui_data;
358 GtkStyle *style; 358 GtkStyle *style;
359 int current_height, max_width; 359 int current_height, max_width;
360 int max_text_width; 360 int max_text_width;
361 GtkTextDirection dir = gtk_widget_get_direction(GTK_WIDGET(grl->tree)); 361 GtkTextDirection dir = gtk_widget_get_direction(GTK_WIDGET(grl->tree));
362 362 cairo_t *cr =
363 style = grl->tipwindow->style; 363 gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(grl->tipwindow)));
364
365 style = gtk_widget_get_style(grl->tipwindow);
364 366
365 max_text_width = MAX(grl->tip_width, grl->tip_name_width); 367 max_text_width = MAX(grl->tip_width, grl->tip_name_width);
366 max_width = TOOLTIP_BORDER + SMALL_SPACE + max_text_width + TOOLTIP_BORDER; 368 max_width = TOOLTIP_BORDER + SMALL_SPACE + max_text_width + TOOLTIP_BORDER;
367 369
368 current_height = 12; 370 current_height = 12;
369 371
370 if (dir == GTK_TEXT_DIR_RTL) { 372 if (dir == GTK_TEXT_DIR_RTL) {
371 gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE, 373 gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
372 NULL, grl->tipwindow, "tooltip", 374 grl->tipwindow, "tooltip",
373 max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000), 375 max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000),
374 current_height, grl->tip_name_layout); 376 current_height, grl->tip_name_layout);
375 } else { 377 } else {
376 gtk_paint_layout (style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE, 378 gtk_paint_layout (style, cr, GTK_STATE_NORMAL, FALSE,
377 NULL, grl->tipwindow, "tooltip", 379 grl->tipwindow, "tooltip",
378 TOOLTIP_BORDER + SMALL_SPACE, current_height, grl->tip_name_layout); 380 TOOLTIP_BORDER + SMALL_SPACE, current_height, grl->tip_name_layout);
379 } 381 }
380 if (dir != GTK_TEXT_DIR_RTL) { 382 if (dir != GTK_TEXT_DIR_RTL) {
381 gtk_paint_layout (style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE, 383 gtk_paint_layout (style, cr, GTK_STATE_NORMAL, FALSE,
382 NULL, grl->tipwindow, "tooltip", 384 grl->tipwindow, "tooltip",
383 TOOLTIP_BORDER + SMALL_SPACE, current_height + grl->tip_name_height, grl->tip_layout); 385 TOOLTIP_BORDER + SMALL_SPACE, current_height + grl->tip_name_height, grl->tip_layout);
384 } else { 386 } else {
385 gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE, 387 gtk_paint_layout(style, cr, GTK_STATE_NORMAL, FALSE,
386 NULL, grl->tipwindow, "tooltip", 388 grl->tipwindow, "tooltip",
387 max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000), 389 max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000),
388 current_height + grl->tip_name_height, 390 current_height + grl->tip_name_height,
389 grl->tip_layout); 391 grl->tip_layout);
390 } 392 }
393 cairo_destroy(cr);
394
391 return FALSE; 395 return FALSE;
392 } 396 }
393 397
394 static gboolean pidgin_roomlist_create_tip(PurpleRoomlist *list, GtkTreePath *path) 398 static gboolean pidgin_roomlist_create_tip(PurpleRoomlist *list, GtkTreePath *path)
395 { 399 {

mercurial