Calendar: Don't assign next_month button variable to add_event button

This commit is contained in:
rhin123 2020-03-18 11:21:54 -05:00 committed by Andreas Kling
parent 961b4f2577
commit dc680d57aa
Notes: sideshowbarker 2024-07-19 08:15:14 +09:00
2 changed files with 5 additions and 4 deletions

View file

@ -49,10 +49,10 @@ CalendarWidget::CalendarWidget()
update_calendar_tiles(m_target_year, m_target_month);
};
m_prev_month_button = add<GUI::Button>();
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<GUI::Button>();
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());
};

View file

@ -20,6 +20,7 @@ private:
RefPtr<GUI::Label> m_selected_date_label;
RefPtr<GUI::Button> m_prev_month_button;
RefPtr<GUI::Button> m_next_month_button;
RefPtr<GUI::Button> m_add_event_button;
class CalendarTile final : public GUI::Frame {
C_OBJECT(CalendarTile)