views/week-grid: Port to GListModel
And, while at it, rewrite the layout algorithm to operate on blocks of overlapping events, and segmented columns. Like the month view row, layouts blocks are invalidated at any point in time, but recalculated immediately before a relayout happens. The reason for doing such a massive rewrite while in the middle of the port to GListModel is because it's easier to handle GListModel data with this approach, than with the previous approach of storing it all in a GcalRangeTree. Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1153 Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
This commit is contained in:
committed by
Marge Bot
parent
5fe24582d4
commit
fa03c6f9af
@@ -494,14 +494,6 @@ static void
|
||||
gcal_week_view_add_event (GcalTimelineSubscriber *subscriber,
|
||||
GcalEvent *event)
|
||||
{
|
||||
GcalWeekView *self = GCAL_WEEK_VIEW (subscriber);
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
if (!gcal_event_is_multiday (event) && !gcal_event_get_all_day (event))
|
||||
gcal_week_grid_add_event (GCAL_WEEK_GRID (self->week_grid), event);
|
||||
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -509,31 +501,12 @@ gcal_week_view_update_event (GcalTimelineSubscriber *subscriber,
|
||||
GcalEvent *old_event,
|
||||
GcalEvent *event)
|
||||
{
|
||||
GcalWeekView *self = GCAL_WEEK_VIEW (subscriber);
|
||||
const gchar *event_id;
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
event_id = gcal_event_get_uid (old_event);
|
||||
gcal_week_grid_remove_event (GCAL_WEEK_GRID (self->week_grid), event_id);
|
||||
|
||||
gcal_week_view_add_event (subscriber, event);
|
||||
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_week_view_remove_event (GcalTimelineSubscriber *subscriber,
|
||||
GcalEvent *event)
|
||||
{
|
||||
GcalWeekView *self = GCAL_WEEK_VIEW (subscriber);
|
||||
const gchar *uuid = gcal_event_get_uid (event);
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
gcal_week_grid_remove_event (GCAL_WEEK_GRID (self->week_grid), uuid);
|
||||
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -547,6 +520,7 @@ gcal_week_view_set_model (GcalTimelineSubscriber *subscriber,
|
||||
self = GCAL_WEEK_VIEW (subscriber);
|
||||
|
||||
gcal_week_header_set_model (GCAL_WEEK_HEADER (self->header), model);
|
||||
gcal_week_grid_set_model (GCAL_WEEK_GRID (self->week_grid), model);
|
||||
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user