forked from AuroraMiddleware/gtk
gtk: Use gtk_style_context_get()
... instead of soon-to-be-deprecated gtk_style_context_get_font().
This commit is contained in:
parent
7747910b9d
commit
055b5d83d5
@ -1768,7 +1768,7 @@ get_size (GtkCellRenderer *cell,
|
||||
style_context = gtk_widget_get_style_context (widget);
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
|
||||
font_desc = pango_font_description_copy_static (gtk_style_context_get_font (style_context, state));
|
||||
gtk_style_context_get (style_context, state, "font", &font_desc, NULL);
|
||||
pango_font_description_merge_static (font_desc, priv->font, TRUE);
|
||||
|
||||
if (priv->scale_set)
|
||||
|
@ -298,7 +298,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
|
||||
if (values->font)
|
||||
pango_font_description_free (values->font);
|
||||
|
||||
values->font = pango_font_description_copy (gtk_style_context_get_font (context, state));
|
||||
gtk_style_context_get (context, state, "font", &values->font, NULL);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
|
@ -6919,7 +6919,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
|
||||
if (values->font)
|
||||
pango_font_description_free (values->font);
|
||||
|
||||
values->font = pango_font_description_copy (gtk_style_context_get_font (context, state));
|
||||
gtk_style_context_get (context, state, "font", &values->font, NULL);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
|
@ -8738,18 +8738,21 @@ static void
|
||||
update_pango_context (GtkWidget *widget,
|
||||
PangoContext *context)
|
||||
{
|
||||
const PangoFontDescription *font_desc;
|
||||
PangoFontDescription *font_desc;
|
||||
GtkStyleContext *style_context;
|
||||
|
||||
style_context = gtk_widget_get_style_context (widget);
|
||||
|
||||
font_desc = gtk_style_context_get_font (style_context,
|
||||
gtk_widget_get_state_flags (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