projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
419f369
)
removed usage of deprecated gtk_get_style
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 2 Apr 2012 17:25:51 +0000
(17:25 +0000)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 2 Apr 2012 17:25:51 +0000
(17:25 +0000)
src/graph.c
patch
|
blob
|
history
diff --git
a/src/graph.c
b/src/graph.c
index
26a84d3
..
5df5838
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-78,25
+78,27
@@
draw_graph_background(cairo_t *cr,
int width, int height, struct config *config,
GtkWidget *widget)
{
int width, int height, struct config *config,
GtkWidget *widget)
{
- GtkStyle
*style
;
- struct color *bgcolor
= config->graph_bgcolor
;
- Gdk
Color *bg
;
+ GtkStyle
Context* style_ctx
;
+ struct color *bgcolor;
+ Gdk
RGBA rgba
;
- style = gtk_widget_get_style(widget);
-
- bg = &style->bg[GTK_STATE_NORMAL];
+ bgcolor = config->graph_bgcolor;
+ style_ctx = gtk_widget_get_style_context(widget);
+ gtk_style_context_get_background_color(style_ctx,
+ GTK_STATE_FLAG_NORMAL,
+ &rgba);
if (config->alpha_channel_enabled)
cairo_set_source_rgba(cr,
if (config->alpha_channel_enabled)
cairo_set_source_rgba(cr,
-
((double)bg->red) / 65535
,
-
((double)bg->green) / 65535
,
-
((double)bg->blue) / 65535
,
+
rgba.red
,
+
rgba.green
,
+
rgba.blue
,
config->graph_bg_alpha);
else
cairo_set_source_rgb(cr,
config->graph_bg_alpha);
else
cairo_set_source_rgb(cr,
-
((double)bg->red) / 65535
,
-
((double)bg->green) / 65535
,
-
((double)bg->blue) / 65535
);
+
rgba.red
,
+
rgba.green
,
+
rgba.blue
);
cairo_rectangle(cr, 0, 0, width, height);
cairo_fill(cr);
cairo_rectangle(cr, 0, 0, width, height);
cairo_fill(cr);