comparison gtk3/dw.c @ 892:82f68adde8a0

Fix for dw_draw_text() not using the background color on GTK3.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 17 Apr 2011 03:34:18 +0000
parents 21ed1421399c
children 2ba1f71e23fa
comparison
equal deleted inserted replaced
891:3774af45eb0c 892:82f68adde8a0
6864 6864
6865 pango_layout_set_font_description(layout, font); 6865 pango_layout_set_font_description(layout, font);
6866 pango_layout_set_text(layout, text, strlen(text)); 6866 pango_layout_set_text(layout, text, strlen(text));
6867 6867
6868 gdk_cairo_set_source_color (cr, &_foreground[index]); 6868 gdk_cairo_set_source_color (cr, &_foreground[index]);
6869 /* Create a background color attribute if required */
6870 if(!_transparent[index])
6871 {
6872 PangoAttrList *list = pango_layout_get_attributes(layout);
6873 PangoAttribute *attr = pango_attr_background_new(_background[index].red,
6874 _background[index].green,
6875 _background[index].blue);
6876 if(!list)
6877 {
6878 list = pango_attr_list_new();
6879 }
6880 pango_attr_list_change(list, attr);
6881 pango_layout_set_attributes(layout, list);
6882 }
6883 /* Do the drawing */
6869 cairo_move_to(cr, x, y); 6884 cairo_move_to(cr, x, y);
6870 pango_cairo_show_layout (cr, layout); 6885 pango_cairo_show_layout (cr, layout);
6871 6886
6872 g_object_unref(layout); 6887 g_object_unref(layout);
6873 } 6888 }