summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2016-01-04 16:49:44 -0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2016-01-04 16:50:47 -0200
commit6de0376ab627cfb82392b11993db3c248e481717 (patch)
tree024ef659fc77250088a3bc01b3a856902c68f61a
parent21f3ed1ef16a4bda7f8c8374b120d91200be4970 (diff)
downloadgnome-calendar-wip/gbsneto/css-nodes.tar.gz
month-view: fix warningswip/gbsneto/css-nodes
We were calling gtk_style_context_get() with a state different than that of the style_context, which yiels warnings. Fix that by saving, setting the flag and restoring the context.
-rw-r--r--src/gcal-month-view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 9061bf8b..1d16da8f 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -1300,7 +1300,11 @@ gcal_month_view_draw (GtkWidget *widget,
context = gtk_widget_get_style_context (widget);
state = gtk_style_context_get_state (context);
+ /* Get font description */
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state | GTK_STATE_FLAG_SELECTED);
gtk_style_context_get (context, state | GTK_STATE_FLAG_SELECTED, "font", &sfont_desc, NULL);
+ gtk_style_context_restore (context);
gtk_widget_get_allocation (widget, &alloc);
start_grid_y = get_start_grid_y (widget);
@@ -1569,7 +1573,12 @@ gcal_month_view_draw (GtkWidget *widget,
last_mark = tmp;
}
+ /* Retrieve the selection color */
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state | GTK_STATE_FLAG_SELECTED);
gtk_style_context_get_color (context, state | GTK_STATE_FLAG_SELECTED, &color);
+ gtk_style_context_restore (context);
+
gdk_cairo_set_source_rgba (cr, &color);
cairo_set_line_width (cr, 0.4);