[gnome-calendar/gnome-3-20] month-view: consider the top padding for the extra events popover



commit a54f76f7af9b33fceed6abf4e5bd2318e44fb63b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun May 8 14:13:01 2016 -0300

    month-view: consider the top padding for the extra events popover
    
    When the mouse button is released, only the bottom padding was being
    taken into account to calculate whether the click was in the "Show
    N events" area.
    
    This commit fixes this issue by considering the top padding as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765678

 src/gcal-month-view.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 0d91d9c..9829ad3 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -329,7 +329,7 @@ gather_button_event_data (GcalMonthView *view,
 
   PangoLayout *overflow_layout;
   PangoFontDescription *ofont_desc;
-  gint font_height, padding_bottom;
+  gint font_height, padding_bottom, padding_top;
 
   priv = gcal_month_view_get_instance_private (view);
   widget = GTK_WIDGET (view);
@@ -346,7 +346,11 @@ gather_button_event_data (GcalMonthView *view,
   state = gtk_style_context_get_state (context);
   gtk_style_context_save (context);
   gtk_style_context_add_class (context, "overflow");
-  gtk_style_context_get (context, state, "font", &ofont_desc, "padding-bottom", &padding_bottom, NULL);
+  gtk_style_context_get (context, state,
+                         "font", &ofont_desc,
+                         "padding-bottom", &padding_bottom,
+                         "padding-top", &padding_top,
+                         NULL);
 
   overflow_layout = gtk_widget_create_pango_layout (widget, NULL);
   pango_layout_set_font_description (overflow_layout, ofont_desc);
@@ -370,7 +374,7 @@ gather_button_event_data (GcalMonthView *view,
       gdouble upper_border = cell_height * ((gint) y / (gint) cell_height);
       y = y - upper_border;
 
-      *out_on_indicator = (cell_height - font_height - padding_bottom < y && y < cell_height);
+      *out_on_indicator = (cell_height - font_height - padding_bottom - padding_top < y && y < cell_height);
     }
 
   if (out_x != NULL)


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