[gnome-calendar] month-view: match style context state from child



commit 1c52e36c717f019905de259443c7dc5aea3c4266
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Mar 9 12:04:28 2016 -0300

    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 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index b7ebf57..8bb8fd1 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]