mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-13 09:50:36 +00:00
Calendar: Implement add event action
This commit is contained in:
parent
06604c3786
commit
cd84544706
Notes:
sideshowbarker
2024-07-19 07:45:13 +09:00
Author: https://github.com/RyanGrieb Commit: https://github.com/SerenityOS/serenity/commit/cd845447066 Pull-request: https://github.com/SerenityOS/serenity/pull/1721
1 changed files with 10 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue