Stop using deprecated style context api

Use the non-deprecated one it wraps, instead.
Yes, this is cheating...
This commit is contained in:
Matthias Clasen 2019-03-31 15:03:57 -04:00
parent 396513183b
commit 6f5675ef3c
6 changed files with 8 additions and 22 deletions

View File

@ -2382,9 +2382,7 @@ gtk_flow_box_snapshot (GtkWidget *widget,
cairo_append_path (cr, path); cairo_append_path (cr, path);
cairo_path_destroy (path); cairo_path_destroy (path);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "border-color", &border_color, NULL);
gtk_style_context_get_border_color (context, &border_color);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_get_border (context, &border); gtk_style_context_get_border (context, &border);
cairo_set_line_width (cr, border.left); cairo_set_line_width (cr, border.left);

View File

@ -1310,10 +1310,8 @@ gtk_popover_snapshot (GtkWidget *widget,
if (border.bottom > 0) if (border.bottom > 0)
{ {
GdkRGBA border_color; GdkRGBA border_color;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_border_color (context, &border_color);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_get (context, "border-color", &border_color, NULL);
gtk_popover_apply_tail_path (popover, cr); gtk_popover_apply_tail_path (popover, cr);
gdk_cairo_set_source_rgba (cr, &border_color); gdk_cairo_set_source_rgba (cr, &border_color);

View File

@ -1992,9 +1992,7 @@ _gtk_style_context_get_attributes (AtkAttributeSet *attributes,
GdkRGBA color; GdkRGBA color;
gchar *value; gchar *value;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "background-color", &color, NULL);
gtk_style_context_get_background_color (context, &color);
G_GNUC_END_IGNORE_DEPRECATIONS
value = g_strdup_printf ("%u,%u,%u", value = g_strdup_printf ("%u,%u,%u",
(guint) ceil (color.red * 65536 - color.red), (guint) ceil (color.red * 65536 - color.red),
(guint) ceil (color.green * 65536 - color.green), (guint) ceil (color.green * 65536 - color.green),

View File

@ -580,11 +580,9 @@ render_para (GtkTextRenderer *text_renderer,
selection_node = gtk_text_view_get_selection_node ((GtkTextView*)text_renderer->widget); selection_node = gtk_text_view_get_selection_node ((GtkTextView*)text_renderer->widget);
gtk_style_context_save_to_node (context, selection_node); gtk_style_context_save_to_node (context, selection_node);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "background-color", &selection, NULL);
gtk_style_context_get_background_color (context, &selection);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_restore (context); gtk_style_context_restore (context);
do do
{ {
@ -775,9 +773,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
{ {
GdkRGBA color; GdkRGBA color;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "background-color", &color, NULL);
gtk_style_context_get_background_color (context, &color);
G_GNUC_END_IGNORE_DEPRECATIONS
gdk_cairo_set_source_rgba (cr, &color); gdk_cairo_set_source_rgba (cr, &color);

View File

@ -250,9 +250,7 @@ set_attributes_from_style (GtkStyleContext *context,
if (!values->appearance.fg_rgba) if (!values->appearance.fg_rgba)
values->appearance.fg_rgba = gdk_rgba_copy (&black); values->appearance.fg_rgba = gdk_rgba_copy (&black);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_get_color (context, values->appearance.fg_rgba); gtk_style_context_get_color (context, values->appearance.fg_rgba);
if (values->font) if (values->font)

View File

@ -7310,9 +7310,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
context = gtk_widget_get_style_context (GTK_WIDGET (text_view)); context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_get_color (context, values->appearance.fg_rgba); gtk_style_context_get_color (context, values->appearance.fg_rgba);
if (values->font) if (values->font)