gui: Extend the GcalView interface with a method to redraw the weekday layout
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
This commit is contained in:
@@ -729,6 +729,15 @@ on_window_undo_delete_event_cb (GSimpleAction *action,
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
on_week_start_day_changed_cb (GcalWindow *self)
|
||||
{
|
||||
g_assert (GCAL_IS_WINDOW (self));
|
||||
|
||||
for (size_t i = 0; i < GCAL_WINDOW_VIEW_N_VIEWS; ++i)
|
||||
gcal_view_first_weekday_changed (GCAL_VIEW (self->views[i]));
|
||||
}
|
||||
|
||||
static void
|
||||
on_breakpoint_changed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
@@ -1497,6 +1506,11 @@ gcal_window_init (GcalWindow *self)
|
||||
G_SETTINGS_BIND_SET | G_SETTINGS_BIND_GET);
|
||||
|
||||
g_signal_connect (self->agenda_page, "notify::visible", G_CALLBACK (on_agenda_page_visible_changed_cb), self);
|
||||
|
||||
g_signal_connect_object (context, "notify::week-start-day",
|
||||
G_CALLBACK (on_week_start_day_changed_cb),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -294,3 +294,12 @@ gcal_view_event_activated (GcalView *self,
|
||||
|
||||
g_signal_emit (self, signals[EVENT_ACTIVATED], 0, event_widget);
|
||||
}
|
||||
|
||||
void
|
||||
gcal_view_first_weekday_changed (GcalView *self)
|
||||
{
|
||||
g_assert (GCAL_IS_VIEW (self));
|
||||
g_assert (GCAL_VIEW_GET_IFACE (self)->first_weekday_changed != NULL);
|
||||
|
||||
GCAL_VIEW_GET_IFACE (self)->first_weekday_changed (self);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@ struct _GcalViewInterface
|
||||
GList* (*get_children_by_uuid) (GcalView *view,
|
||||
GcalRecurrenceModType mod,
|
||||
const gchar *uuid);
|
||||
|
||||
void (*first_weekday_changed) (GcalView *view);
|
||||
};
|
||||
|
||||
void gcal_view_set_date (GcalView *view,
|
||||
@@ -76,4 +78,6 @@ GDateTime* gcal_view_get_next_date (GcalView
|
||||
|
||||
GDateTime* gcal_view_get_previous_date (GcalView *self);
|
||||
|
||||
void gcal_view_first_weekday_changed (GcalView *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user