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
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
00b89b89cd
commit
9bbb12691a
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user