mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
GtkWidget: Update pango context from style context's font description.
This commit is contained in:
parent
1cfeeadc70
commit
d9664021cc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user