From 9bbb12691a1d2b09243875e1faf9ed26d6d7da44 Mon Sep 17 00:00:00 2001 From: Abdullahi Usman Date: Wed, 24 May 2017 10:21:23 +0100 Subject: [PATCH] month-view: add margin to overflow layout The overflow layout sit at the bottom of a cell to display "Other X events" when there is no room to accomodate more. The issue is that the overflow layout does not have margin property like other views(layouts) in the cell, so instead it appears either too far from or too close to the border depending on the text it accomodates. We can fix this by setting the margin property. https://bugzilla.gnome.com/show_bug.cgi?id=771581 --- src/views/gcal-month-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/gcal-month-view.c b/src/views/gcal-month-view.c index 1aba53d7..31459d2e 100644 --- a/src/views/gcal-month-view.c +++ b/src/views/gcal-month-view.c @@ -1721,7 +1721,7 @@ gcal_month_view_draw (GtkWidget *widget, overflow_layout = gtk_widget_create_pango_layout (widget, overflow_str); pango_layout_set_font_description (overflow_layout, ofont_desc); - pango_layout_set_width (overflow_layout, pango_units_from_double (cell_width - (font_width + padding.right))); + pango_layout_set_width (overflow_layout, pango_units_from_double (cell_width - (font_width + padding.right + padding.left))); pango_layout_set_alignment (overflow_layout, PANGO_ALIGN_CENTER); pango_layout_set_ellipsize (overflow_layout, PANGO_ELLIPSIZE_END); pango_layout_get_pixel_size (overflow_layout, &font_width, &font_height); @@ -1734,7 +1734,7 @@ gcal_month_view_draw (GtkWidget *widget, cell_width, font_height + padding.bottom * 2); } - gtk_render_layout (context, cr, cell_width * column, y_value, overflow_layout); + gtk_render_layout (context, cr, cell_width * column + padding.left, y_value, overflow_layout); gtk_style_context_remove_class (context, "overflow"); gtk_style_context_restore (context);