removed useless parameters
[psensor.git] / src / graph.c
index 6cc8097..de423d9 100644 (file)
@@ -48,7 +48,6 @@ struct graph_info {
 
        /* Background color of the current desktop theme */
        GdkRGBA theme_bg_color;
-
        /* Foreground color of the current desktop theme */
        GdkRGBA theme_fg_color;
 };
@@ -129,35 +128,27 @@ static void draw_left_region(cairo_t *cr, struct graph_info *info)
 
 static void
 draw_graph_background(cairo_t *cr,
-                     int g_xoff, int g_yoff,
                      int g_width, int g_height,
-                     int width, int height, struct config *config,
-                     GtkWidget *window)
+                     int width, struct config *config,
+                     struct graph_info *info)
 {
-       GtkStyleContext *style_ctx;
        struct color *bgcolor;
-       GdkRGBA rgba;
 
        bgcolor = config->graph_bgcolor;
 
-       style_ctx = gtk_widget_get_style_context(window);
-       gtk_style_context_get_background_color(style_ctx,
-                                              GTK_STATE_FLAG_NORMAL,
-                                              &rgba);
-
        if (config->alpha_channel_enabled)
                cairo_set_source_rgba(cr,
-                                     rgba.red,
-                                     rgba.green,
-                                     rgba.blue,
+                                     info->theme_bg_color.red,
+                                     info->theme_bg_color.green,
+                                     info->theme_bg_color.blue,
                                      config->graph_bg_alpha);
        else
                cairo_set_source_rgb(cr,
-                                    rgba.red,
-                                    rgba.green,
-                                    rgba.blue);
+                                    info->theme_bg_color.red,
+                                    info->theme_bg_color.green,
+                                    info->theme_bg_color.blue);
 
-       cairo_rectangle(cr, g_xoff, 0, g_width, height);
+       cairo_rectangle(cr, info->g_xoff, 0, g_width, info->height);
        cairo_fill(cr);
 
        if (config->alpha_channel_enabled)
@@ -172,7 +163,7 @@ draw_graph_background(cairo_t *cr,
                                     bgcolor->green,
                                     bgcolor->blue);
 
-       cairo_rectangle(cr, g_xoff, g_yoff, g_width, g_height);
+       cairo_rectangle(cr, info->g_xoff, info->g_yoff, g_width, g_height);
        cairo_fill(cr);
 }
 
@@ -484,9 +475,9 @@ graph_update(struct psensor **sensors,
        g_width = width - g_xoff - GRAPH_H_PADDING;
 
        draw_graph_background(cr,
-                             g_xoff, g_yoff, g_width, g_height,
-                             width, height, config,
-                             window);
+                             g_width, g_height,
+                             width, config,
+                             &info);
 
        /* Set the color for text drawing */
        cairo_set_source_rgb(cr,