Instead of breaking the vertical alignment of events by
drawing icons both at the start and end of the widget,
only draw them by the end.
This commit also improves drawing for RTL locales.
We differentiate all day events from timed events by their
ordering, but we don't give any visual clues of this
differentiation.
Fix that by adding the start time of the event when it's a
timed event.
https://bugzilla.gnome.org/show_bug.cgi?id=753131
When we finalize, we remove the event. Normally this means
that the event also gets finalized, as the widget almost
always holds the only reference to the event.
However, there are some rare cases where we finalize the widget
but not the event. If the event the updates the color or the
summary, we try to redraw the finalized widget and crash.
Fix that by disconnecting the signals when finalizing the widget.
The compare_for_single_day() method is reproducing the
same functionality from gcal_event_compare(), and the only
consumer is the Year View. So, for now, simplify the
comparing function and put it in year view file.
Also, this commit vastly improves and documents the year
view's algorithm to add events to the sidebar list.
For now, we're going to convert every widget time into our timezone
without question. Further along the way, when we have a more complete
edit-dialog we can handle this in a less strict manner.
Size requisition previously add margin to the size requested. Margin
should be taken into account outside of the widget. Moving margin to the
container and use border, which previously was not used.
This compare function is made to sort using the same two methods used
before but together, giving priority to the longer events.
The idea is sort event properly on year-view's sidebar.
This function will probably change later.
When an event is marked all day, the end-date is always one day ahead of
the true end of the event, and both dates are marked as date. We need to
take this into account.
Added GcalEventWidget::is_multiday to check if an event span more than
one day.
Added GcalEventWidget::compare_by_length which compares two event
widgets according to the duration of the events they represent.
Fix the sigsegv in edit-dialog and event-widgets when there's no
end-date set.
Set a guard in Utils::gcal_dup_icaltime function.
There's still some problems with the events showing the first time but
not anymore.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=736002
Previously the scaling was made to the size of the text layout which
caused a blurriness of the icon. Making its size a multiple of 16 made
the icon preserve its sharpness.
There are some other changes:
1. Renamed widget class to "event-widget" to avoid collisions
2. Added contrasting event title coloring
3. Use gtk_render functions
The changes made here are minimal to get this building. GcalEventWidget
needs a new rethink and rework to accommodate to those new internal
attributes, which replaces some of the old ones.