inspector: Use gtk_widget_get_style_color
authorMatthias Clasen <mclasen@redhat.com>
Wed, 12 Oct 2022 18:52:57 +0000 (14:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 12 Oct 2022 19:35:00 +0000 (15:35 -0400)
The graph renderer in the statistics page needs
the CSS foreground color to draw the graph. Use
the just introduced api for it.

gtk/inspector/graphrenderer.c

index 595f82213e0f0ef5c33cad8916b41702e7c03dbf..0fb1f0d427dc71a98b34bc3394ea6b445c0321f0 100644 (file)
@@ -22,7 +22,6 @@
 #include "graphdata.h"
 
 #include "gtksnapshot.h"
-#include "deprecated/gtkstylecontext.h"
 
 enum {
   PROP_0,
@@ -131,7 +130,6 @@ graph_renderer_snapshot (GtkWidget   *widget,
                          GtkSnapshot *snapshot)
 {
   GraphRenderer *self = GRAPH_RENDERER (widget);
-  GtkStyleContext *context;
   double minimum, maximum, diff;
   double x, y, width, height;
   cairo_t *cr;
@@ -155,10 +153,7 @@ graph_renderer_snapshot (GtkWidget   *widget,
 
   diff = maximum - minimum;
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  context = gtk_widget_get_style_context (widget);
-  gtk_style_context_get_color (context, &color);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_widget_get_style_color (widget, &color);
 
   cr = gtk_snapshot_append_cairo (snapshot,
                                   &GRAPHENE_RECT_INIT (