[gnome-system-monitor/wip/update-interface] Fixed warnings on style flags



commit 71a9ccda813228cf8f41bb7c39b1e60fa11fbffa
Author: Robert Roth <robert roth off gmail com>
Date:   Thu Nov 5 21:42:27 2020 +0200

    Fixed warnings on style flags

 src/legacy/gsm_color_button.c | 3 +--
 src/load-graph.cpp            | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/legacy/gsm_color_button.c b/src/legacy/gsm_color_button.c
index 81aebb7e..02a8ad32 100644
--- a/src/legacy/gsm_color_button.c
+++ b/src/legacy/gsm_color_button.c
@@ -235,8 +235,7 @@ gsm_color_button_draw (GtkWidget *widget, cairo_t * cr)
     color->green = MIN (1.0, color->green + highlight_factor);
   } else if (!sensitive) {
     GtkStyleContext *context = gtk_widget_get_style_context (widget);
-    
-    gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, color);
+    gtk_style_context_get_color (context, gtk_widget_get_state_flags (widget), color);
   }
   gdk_cairo_set_source_rgba (cr, color);
   gdk_rgba_free(color);
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 715be931..64a601d7 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -84,7 +84,7 @@ static void draw_background(LoadGraph *graph) {
 
     GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (GsmApplication::get()->stack));
     
-    gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
+    gtk_style_context_get_color (context, gtk_widget_get_state_flags (GTK_WIDGET 
(GsmApplication::get()->stack)), &fg);
 
     cairo_paint_with_alpha (cr, 0.0);
     layout = pango_cairo_create_layout (cr);
@@ -93,7 +93,7 @@ static void draw_background(LoadGraph *graph) {
     pango_layout_set_attributes (layout, attrs);
     g_clear_pointer (&attrs, pango_attr_list_unref);
 
-    gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL, GTK_STYLE_PROPERTY_FONT, &font_desc, NULL);
+    gtk_style_context_get (context, gtk_widget_get_state_flags (GTK_WIDGET (GsmApplication::get()->stack)), 
GTK_STYLE_PROPERTY_FONT, &font_desc, NULL);
     pango_font_description_set_size (font_desc, 0.8 * graph->fontsize * PANGO_SCALE);
     pango_layout_set_font_description (layout, font_desc);
     pango_font_description_free (font_desc);
@@ -120,7 +120,7 @@ static void draw_background(LoadGraph *graph) {
     gtk_style_context_add_class (context, GTK_STYLE_CLASS_ENTRY);
 
     /* And, as a bonus, the user can choose the color of the grid. */
-    gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg_grid);
+    gtk_style_context_get_color (context, gtk_widget_get_state_flags (GTK_WIDGET 
(GsmApplication::get()->stack)), &fg_grid);
 
     /* Why not use the new features of the
      * GTK instead of cairo_rectangle ?! :) */


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