[gnome-calendar/gnome-3-24] month-view: add margin to overflow layout



commit bf33b53ffc7a6f9e7284aeaa557ccfe5a7c8bb95
Author: Abdullahi Usman <abdullahismn7 gmail com>
Date:   Wed May 24 10:21:23 2017 +0100

    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 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/views/gcal-month-view.c b/src/views/gcal-month-view.c
index 1aba53d..31459d2 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);


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