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:
@@ -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
|
||||
|
||||
+240
-705
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user