[gtk/deprecations: 1/2] Stop using deprecated style context api



commit 792f96dfbf459b6a87a22179c883aac1c2412214
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Mar 31 15:03:57 2019 -0400

    Stop using deprecated style context api
    
    Use the non-deprecated one it wraps, instead.
    Yes, this is cheating...

 gtk/gtkflowbox.c     | 4 +---
 gtk/gtkpopover.c     | 4 +---
 gtk/gtktextdisplay.c | 6 ++----
 gtk/gtktextutil.c    | 4 +---
 gtk/gtktextview.c    | 4 +---
 5 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 65c491fe4b..015a48e8ab 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -2382,9 +2382,7 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
           cairo_append_path (cr, path);
           cairo_path_destroy (path);
 
-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_style_context_get_border (context, &border);
 
           cairo_set_line_width (cr, border.left);
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index a39270c5a7..dba89e511c 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1310,10 +1310,8 @@ gtk_popover_snapshot (GtkWidget   *widget,
   if (border.bottom > 0)
     {
       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);
       gdk_cairo_set_source_rgba (cr, &border_color);
 
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 4e6c49fd16..8887ddcb56 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -580,11 +580,9 @@ render_para (GtkTextRenderer    *text_renderer,
   selection_node = gtk_text_view_get_selection_node ((GtkTextView*)text_renderer->widget);
   gtk_style_context_save_to_node (context, selection_node);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, &selection);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", &selection, NULL);
 
- gtk_style_context_restore (context);
+  gtk_style_context_restore (context);
 
   do
     {
diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c
index 9858bec5ad..651b92abd9 100644
--- a/gtk/gtktextutil.c
+++ b/gtk/gtktextutil.c
@@ -250,9 +250,7 @@ set_attributes_from_style (GtkStyleContext   *context,
   if (!values->appearance.fg_rgba)
     values->appearance.fg_rgba = gdk_rgba_copy (&black);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
   gtk_style_context_get_color (context, values->appearance.fg_rgba);
 
   if (values->font)
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 0f378211e8..f0b3c3aeb5 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -7310,9 +7310,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView        *text_view,
 
   context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", values->appearance.bg_rgba);
   gtk_style_context_get_color (context, values->appearance.fg_rgba);
 
   if (values->font)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]