shell: Fix bad rendering of search results

Don't use pango_cairo_layout_path(), which doesn't do any
hinting whatsoever, use gtk_render_layout() from GTK+ instead,
as the text cell renderer already does.

With help from Matthias Clasen <mclasen@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=652709
This commit is contained in:
Bastien Nocera 2011-06-21 15:10:08 +01:00
parent c63f09dc0e
commit a37f8770e5

View file

@ -277,18 +277,22 @@ shell_search_renderer_render (GtkCellRenderer *cell,
{ {
ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv; ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
PangoRectangle rect; PangoRectangle rect;
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget); shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
pango_layout_get_pixel_extents (priv->layout, NULL, &rect); pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
cairo_move_to (cr, cell_area->x, cell_area->y); cairo_save (cr);
/* FIXME: get the correct colour from the theme */ gtk_render_layout (context, cr,
cairo_set_source_rgb (cr, 0, 0, 0); cell_area->x,
if (priv->layout) cell_area->y,
pango_cairo_layout_path (cr, priv->layout); priv->layout);
cairo_fill (cr);
cairo_restore (cr);
} }
static void static void