diff --git a/Applications/Calendar/CalendarWidget.cpp b/Applications/Calendar/CalendarWidget.cpp index 821c0551dd..2b8b96a69c 100644 --- a/Applications/Calendar/CalendarWidget.cpp +++ b/Applications/Calendar/CalendarWidget.cpp @@ -49,10 +49,10 @@ CalendarWidget::CalendarWidget() update_calendar_tiles(m_target_year, m_target_month); }; - m_prev_month_button = add(); - m_prev_month_button->set_text("Add Event"); - m_prev_month_button->set_relative_rect(475, 13, 100, 25); - m_prev_month_button->on_click = [this] { + m_add_event_button = add(); + m_add_event_button->set_text("Add Event"); + m_add_event_button->set_relative_rect(475, 13, 100, 25); + m_add_event_button->on_click = [this] { AddEventDialog::show(m_calendar, window()); }; diff --git a/Applications/Calendar/CalendarWidget.h b/Applications/Calendar/CalendarWidget.h index 5dd60a0f53..930921be1d 100644 --- a/Applications/Calendar/CalendarWidget.h +++ b/Applications/Calendar/CalendarWidget.h @@ -20,6 +20,7 @@ private: RefPtr m_selected_date_label; RefPtr m_prev_month_button; RefPtr m_next_month_button; + RefPtr m_add_event_button; class CalendarTile final : public GUI::Frame { C_OBJECT(CalendarTile)