mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
This commit is contained in:
parent
5300896095
commit
bd61e75e0b
51 changed files with 294 additions and 302 deletions
|
@ -67,7 +67,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
tree_map_widget.set_focus(true);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
auto file_menu = window->add_menu("&File"_string);
|
||||
file_menu->add_action(GUI::Action::create("&Analyze", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv)), [&](auto&) {
|
||||
// FIXME: Just modify the tree in memory instead of traversing the entire file system
|
||||
if (auto result = tree_map_widget.analyze(statusbar); result.is_error()) {
|
||||
|
@ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
app->quit();
|
||||
}));
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_string));
|
||||
auto help_menu = window->add_menu("&Help"_string);
|
||||
help_menu->add_action(GUI::CommonActions::make_command_palette_action(window));
|
||||
help_menu->add_action(GUI::CommonActions::make_about_action(APP_NAME, app_icon, window));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue