diff --git a/Userland/Applications/Calendar/CalendarWidget.cpp b/Userland/Applications/Calendar/CalendarWidget.cpp index 48baf2fecd..4777679019 100644 --- a/Userland/Applications/Calendar/CalendarWidget.cpp +++ b/Userland/Applications/Calendar/CalendarWidget.cpp @@ -49,11 +49,12 @@ ErrorOr> CalendarWidget::create(GUI::Window* paren view_month_action->set_checked(true); auto view_year_action = TRY(widget->create_view_year_action()); - auto view_type_action_group = make(); - view_type_action_group->set_exclusive(true); - view_type_action_group->add_action(*view_month_action); - view_type_action_group->add_action(*view_year_action); + widget->m_view_type_action_group = make(); + widget->m_view_type_action_group->set_exclusive(true); + widget->m_view_type_action_group->add_action(*view_month_action); + widget->m_view_type_action_group->add_action(*view_year_action); + auto default_view = Config::read_string("Calendar"sv, "View"sv, "DefaultView"sv, "Month"sv); if (default_view == "Year") view_year_action->set_checked(true); diff --git a/Userland/Applications/Calendar/CalendarWidget.h b/Userland/Applications/Calendar/CalendarWidget.h index 4659928cea..383542535e 100644 --- a/Userland/Applications/Calendar/CalendarWidget.h +++ b/Userland/Applications/Calendar/CalendarWidget.h @@ -42,6 +42,8 @@ private: ErrorOr> create_view_year_action(); ErrorOr> create_open_settings_action(); + OwnPtr m_view_type_action_group; + RefPtr m_event_calendar; };