month-view-row: Rewrite layout algorithm

Calculate event blocks upfront, in a way that is agnostic to
pixel sizes, and keep them alive as long the event is around.

Calculate which event blocks are visible at layout time, and
only set the child visibility of the event widgets, instead
of truly showing or hiding them. This makes size_allocate not
queue relayouts.

There are many opportunities for optimizations that we can
eventually land, but this seems to work decently so far.

RTL support is still missing.
This commit is contained in:
Georges Basile Stavracas Neto
2023-08-11 15:13:44 -03:00
parent b775256ef8
commit f9f9ccbb8c
2 changed files with 240 additions and 707 deletions
-2
View File
@@ -597,7 +597,6 @@ gcal_dazzling_month_view_add_event (GcalTimelineSubscriber *subscriber,
overlap = gcal_range_calculate_overlap (row_range, gcal_event_get_range (event), &position);
if (overlap != GCAL_RANGE_NO_OVERLAP)
{
g_message ("Adding event %s to row %u", gcal_event_get_uid (event), i);
gcal_month_view_row_add_event (row, event);
}
else
@@ -651,7 +650,6 @@ gcal_dazzling_month_view_remove_event (GcalTimelineSubscriber *subscriber,
overlap = gcal_range_calculate_overlap (row_range, gcal_event_get_range (event), &position);
if (overlap != GCAL_RANGE_NO_OVERLAP)
{
g_message ("Remove event %s to row %u", gcal_event_get_uid (event), i);
gcal_month_view_row_remove_event (row, event);
}
else
File diff suppressed because it is too large Load Diff