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
This commit is contained in:
Georges Basile Stavracas Neto
2016-05-08 14:14:56 -03:00
parent 5d825316d4
commit 48df0903e5
+7 -3
View File
@@ -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)