event-widget: Add the timestamp-policy property

This gives some control on what time is displayed on the widget. It will
be used to show the time of the end of an event in the agenda view.
This commit is contained in:
Adrien Plazas
2022-06-16 08:23:45 -03:00
committed by Georges Basile Stavracas Neto
parent 0d27b08803
commit cb439095a5
5 changed files with 91 additions and 20 deletions
+4
View File
@@ -1860,6 +1860,8 @@ gcal_month_view_add_event (GcalTimelineSubscriber *subscriber,
event_widget = gcal_event_widget_new (self->context, event);
gcal_event_widget_set_read_only (GCAL_EVENT_WIDGET (event_widget), gcal_calendar_is_read_only (calendar));
if (!gcal_event_get_all_day (event) && !gcal_event_is_multiday (event))
gcal_event_widget_set_timestamp_policy (GCAL_EVENT_WIDGET (event_widget), GCAL_TIMESTAMP_POLICY_START);
add_event_widget (self, event_widget);
@@ -1894,6 +1896,8 @@ gcal_month_view_update_event (GcalTimelineSubscriber *subscriber,
/* Create and add the new event widget */
new_widget = gcal_event_widget_new (self->context, event);
if (!gcal_event_get_all_day (event) && !gcal_event_is_multiday (event))
gcal_event_widget_set_timestamp_policy (GCAL_EVENT_WIDGET (new_widget), GCAL_TIMESTAMP_POLICY_START);
add_event_widget (self, new_widget);
self->needs_reallocation = TRUE;
+1
View File
@@ -944,6 +944,7 @@ gcal_week_grid_add_event (GcalWeekGrid *self,
"context", self->context,
"event", event,
"orientation", GTK_ORIENTATION_VERTICAL,
"timestamp-policy", GCAL_TIMESTAMP_POLICY_START,
NULL);
gcal_range_tree_add_range (self->events,