GtkWidget: Update pango context from style context's font description.

This commit is contained in:
Carlos Garnacho 2010-11-09 18:31:39 +01:00
parent 1cfeeadc70
commit d9664021cc

View File

@ -8667,12 +8667,22 @@ static void
update_pango_context (GtkWidget *widget,
PangoContext *context)
{
GtkWidgetPrivate *priv = widget->priv;
PangoFontDescription *font_desc;
GtkStyleContext *style_context;
pango_context_set_font_description (context, priv->style->font_desc);
style_context = gtk_widget_get_style_context (widget);
gtk_style_context_get (style_context,
gtk_widget_get_state_flags (widget),
"font", &font_desc,
NULL);
pango_context_set_font_description (context, font_desc);
pango_context_set_base_dir (context,
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
pango_font_description_free (font_desc);
}
static void