summaryrefslogtreecommitdiff
path: root/liblogdiag
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-01-20 09:36:43 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-01-20 09:36:43 +0100
commit1adeac6c22c3a96fc528c348dc6840080ededfe9 (patch)
tree4eb19424ae48756514a3182d12b7e9a8ddfa1af4 /liblogdiag
parent13f212d4e950f5de07be91b8a5bafc748db1c396 (diff)
downloadlogdiag-1adeac6c22c3a96fc528c348dc6840080ededfe9.tar.gz
logdiag-1adeac6c22c3a96fc528c348dc6840080ededfe9.tar.xz
logdiag-1adeac6c22c3a96fc528c348dc6840080ededfe9.zip
Fix additional deprecation warnings
Again with more code.
Diffstat (limited to 'liblogdiag')
-rw-r--r--liblogdiag/ld-category-symbol-view.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/liblogdiag/ld-category-symbol-view.c b/liblogdiag/ld-category-symbol-view.c
index 84f9c22..578fe43 100644
--- a/liblogdiag/ld-category-symbol-view.c
+++ b/liblogdiag/ld-category-symbol-view.c
@@ -340,6 +340,8 @@ on_draw (GtkWidget *widget, cairo_t *cr)
{
LdCategorySymbolView *self;
GSList *iter;
+ GdkRGBA color;
+ GtkStyleContext *context;
self = LD_CATEGORY_SYMBOL_VIEW (widget);
@@ -347,8 +349,10 @@ on_draw (GtkWidget *widget, cairo_t *cr)
if (!gdk_cairo_get_clip_rectangle (cr, &draw_area))
return FALSE;
- gdk_cairo_set_source_color (cr,
- &gtk_widget_get_style (widget)->base[GTK_STATE_NORMAL]);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get_background_color (context,
+ GTK_STATE_FLAG_NORMAL, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
for (iter = self->priv->layout; iter; iter = iter->next)
@@ -363,11 +367,16 @@ on_draw (GtkWidget *widget, cairo_t *cr)
gdk_cairo_rectangle (cr, &data->rect);
cairo_clip (cr);
- gdk_cairo_set_source_color (cr,
- &gtk_widget_get_style (widget)->text[GTK_STATE_NORMAL]);
-
+ GtkStateFlags state = GTK_STATE_FLAG_NORMAL;
if (data == self->priv->preselected)
- cairo_paint_with_alpha (cr, 0.1);
+ state = GTK_STATE_FLAG_SELECTED;
+
+ gtk_style_context_get_background_color (context, state, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
+ cairo_paint (cr);
+
+ gtk_style_context_get_color (context, state, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
cairo_translate (cr, data->rect.x + data->dx, data->rect.y + data->dy);
cairo_scale (cr, data->scale, data->scale);