month-view: improve dates calculation for RTL languages.

Month view used to calculate the event's start date and end date from
the physical layout of the month and compare it with the event's
original start date and end date to see if there is a change and then
update as necessary by either slanted start or end, when either is/are
not equal to the one in the original start and end dates.

However, the way in which the start date and end date in RTL language are
calculated must be different since the layering of the days in the weeks
are opposite.  Month view uses precalculated days number to mirror the
last week, which already chop off the days_delay number from cell_idx value.
In RTL, this cause issues such that the days are calculated wrongly and a
slanted start or end is visible.  Because the date is not the same as the
original events date, month view thinks that the view needs an update and
so tries to update the view wrongly.

We can fix this by using the cell_idx value to calculate the days and then
substracting the days_delay value after that.

https://bugzilla.gnome.org/show_bug.cgi?id=777426
This commit is contained in:
Abdullahi Usman
2017-08-18 23:53:04 -03:00
committed by Georges Basile Stavracas Neto
parent 1b04e6f4f5
commit df08daad68
+1 -1
View File
@@ -1307,7 +1307,7 @@ gcal_month_view_size_allocate (GtkWidget *widget,
/* Day number is calculated differently on RTL languages */
if (self->k)
day = 7 * row + MIRROR (day % 7, 0, 7) - length;
day = 7 * row + MIRROR (cell_idx % 7, 0, 7) - self->days_delay - length + 1;
if (i != 0)
{