From 1c52e36c717f019905de259443c7dc5aea3c4266 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 9 Mar 2016 12:04:28 -0300 Subject: [PATCH] month-view: match style context state from child We were mistakenly using the style context of the view to retrieve the child's margin. Fix that by retrieving the child margin from the child's style context. --- src/gcal-month-view.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index b7ebf57e..8bb8fd10 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -1293,9 +1293,11 @@ gcal_month_view_size_allocate (GtkWidget *widget, if (size_left[i] > natural_height) { - gtk_style_context_get_margin (gtk_widget_get_style_context (child_widget), - gtk_style_context_get_state (context), - &margin); + GtkStyleContext *child_context; + + child_context = gtk_widget_get_style_context (child_widget); + + gtk_style_context_get_margin (child_context, gtk_style_context_get_state (child_context), &margin); pos_x = cell_width * (i % 7) + margin.left; pos_y = cell_height * ((i / 7) + first_row_gap) + start_grid_y + margin.top;