diff options
author | rhin123 <ryanrhin@gmail.com> | 2020-04-09 17:05:48 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-10 11:28:34 +0200 |
commit | cd8454470660c4fac283852c0c49457be803b7d3 (patch) | |
tree | f971c62dc344fa3fb50ecff190c2f7e80824ca7f /Applications/Calendar | |
parent | 06604c3786eac03ccf4ca148efb4f05bc50f6bc2 (diff) | |
download | serenity-cd8454470660c4fac283852c0c49457be803b7d3.zip |
Calendar: Implement add event action
Diffstat (limited to 'Applications/Calendar')
-rw-r--r-- | Applications/Calendar/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Applications/Calendar/main.cpp b/Applications/Calendar/main.cpp index 769cb33d53..132bc00511 100644 --- a/Applications/Calendar/main.cpp +++ b/Applications/Calendar/main.cpp @@ -60,17 +60,25 @@ int main(int argc, char** argv) window->set_title("Calendar"); window->set_rect(20, 200, 596, 475); - window->set_main_widget<CalendarWidget>(); + auto calendar_widget = make<CalendarWidget>(); + window->set_main_widget(calendar_widget); window->show(); window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-calendar.png")); auto menubar = make<GUI::MenuBar>(); - auto& app_menu = menubar->add_menu("Calendar"); + + app_menu.add_action(GUI::Action::create("Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, + [&](const GUI::Action&) { + calendar_widget->show_add_event_window(); + return; + })); + app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { GUI::Application::the().quit(0); return; })); + app.set_menubar(move(menubar)); app.exec(); |