week-view: fix active and current date handling
The active date is the visible date, while the current date is today. We shouldn't confuse those two.
This commit is contained in:
@@ -857,6 +857,7 @@ gcal_week_header_finalize (GObject *object)
|
||||
GcalWeekHeader *self = GCAL_WEEK_HEADER (object);
|
||||
gint i;
|
||||
|
||||
g_clear_pointer (&self->active_date, g_free);
|
||||
g_clear_pointer (&self->current_date, g_free);
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
|
||||
@@ -456,7 +456,8 @@ gcal_week_view_set_property (GObject *object,
|
||||
{
|
||||
case PROP_DATE:
|
||||
{
|
||||
gcal_week_view_set_current_date (self, g_value_dup_boxed (value));
|
||||
g_clear_pointer (&self->date, g_free);
|
||||
self->date = g_value_dup_boxed (value);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -552,12 +553,8 @@ gcal_week_view_set_current_date (GcalWeekView *self,
|
||||
g_return_if_fail (GCAL_IS_WEEK_VIEW (self));
|
||||
|
||||
g_clear_pointer (&self->current_date, g_free);
|
||||
self->date = current_date;
|
||||
self->current_date = current_date;
|
||||
|
||||
gcal_week_header_set_current_date (GCAL_WEEK_HEADER (self->header), current_date);
|
||||
gcal_week_grid_set_current_date (GCAL_WEEK_GRID (self->week_grid), current_date);
|
||||
|
||||
self->current_date = current_date;
|
||||
|
||||
g_object_notify (G_OBJECT (self), "active-date");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user