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



commit 48df0903e5b1dc44b366c7f56a4c44fa92ce3e59
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 d355fcf..96c52d3 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -338,7 +338,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);
@@ -355,7 +355,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);
@@ -379,7 +383,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]