SpaceAnalyzer: Give the Analyze action an icon and F5 shortcut

This action is basically equivalent to "Refresh", so let's use the
common shortcut for that.
This commit is contained in:
Sam Atkins 2023-02-03 14:03:46 +00:00 committed by Andreas Kling
parent 1ec59cc52a
commit 87f4c9e580
Notes: sideshowbarker 2024-07-18 02:13:10 +09:00

View file

@ -62,7 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
treemapwidget.set_focus(true);
auto file_menu = TRY(window->try_add_menu("&File"));
TRY(file_menu->try_add_action(GUI::Action::create("&Analyze", [&](auto&) {
TRY(file_menu->try_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 = treemapwidget.analyze(statusbar); result.is_error()) {
GUI::MessageBox::show_error(window, DeprecatedString::formatted("{}", result.error()));