mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibGUI: Remove Menu::try_add_action()
And fall back to the infallible add_action().
This commit is contained in:
parent
eec328e2ab
commit
f2faf2767f
51 changed files with 758 additions and 769 deletions
|
@ -85,16 +85,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
show_window_frame_action->set_checked(window_frame_enabled);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
TRY(file_menu->try_add_action(move(show_window_frame_action)));
|
||||
file_menu->add_action(move(show_window_frame_action));
|
||||
file_menu->add_separator();
|
||||
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
|
||||
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_string));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
|
||||
help_menu->add_action(GUI::CommonActions::make_command_palette_action(window));
|
||||
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Eyes.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window)));
|
||||
}));
|
||||
help_menu->add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window));
|
||||
|
||||
auto eyes_widget = TRY(window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns));
|
||||
eyes_widget->on_context_menu_request = [&](auto& event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue