1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

Userland: Prefer non-fallible construction for LibGUI objects

This commit is contained in:
Tim Ledbetter 2023-09-18 06:00:51 +01:00 committed by Andreas Kling
parent a4a94de942
commit a6f6a1afd2
54 changed files with 69 additions and 70 deletions

View file

@ -60,10 +60,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
game->toggle_pause();
}));
auto show_shadow_piece_action = TRY(GUI::Action::try_create_checkable("Show Shadow Piece", GUI::Shortcut {}, [&](auto& action) {
auto show_shadow_piece_action = GUI::Action::create_checkable("Show Shadow Piece", GUI::Shortcut {}, [&](auto& action) {
game->set_show_shadow_hint(action.is_checked());
Config::write_bool(app_name, app_name, "ShowShadowPiece"sv, action.is_checked());
}));
});
game->set_show_shadow_hint(Config::read_bool(app_name, app_name, "ShowShadowPiece"sv, true));
show_shadow_piece_action->set_checked(game->show_shadow_hint());