gui: Use the new GcalContext API to get week start day once
This gets the globally set start-of-week setting on application startup. Making the views redraw themselves on setting change while running will be a later step. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
This commit is contained in:
@@ -1083,7 +1083,7 @@ gcal_date_chooser_init (GcalDateChooser *self)
|
||||
self->date = g_date_time_new_now_local ();
|
||||
g_date_time_get_ymd (self->date, &self->this_year, NULL, NULL);
|
||||
|
||||
self->week_start = gcal_util_get_first_weekday_iso ();
|
||||
self->week_start = gcal_context_get_week_start_day (context);
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define G_LOG_DOMAIN "GcalMonthView"
|
||||
|
||||
#include "config.h"
|
||||
#include "gcal-debug.h"
|
||||
#include "gcal-event-widget-pool.h"
|
||||
#include "gcal-gui-utils.h"
|
||||
@@ -194,7 +195,9 @@ allocate_overflow_popover (GcalMonthView *self,
|
||||
static inline void
|
||||
update_weekday_labels (GcalMonthView *self)
|
||||
{
|
||||
const gint first_weekday = gcal_util_get_first_weekday_iso ();
|
||||
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||
|
||||
const gint first_weekday = gcal_context_get_week_start_day (context);
|
||||
|
||||
for (gint i = 0; i < GCAL_N_WEEKDAYS; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user