From 48df0903e5b1dc44b366c7f56a4c44fa92ce3e59 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sun, 8 May 2016 14:13:01 -0300 Subject: [PATCH] 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 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index d355fcf7..96c52d3d 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)