1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:57:45 +00:00

GameOfLife: Show status tips in Statusbar

This commit is contained in:
Sam Atkins 2023-06-17 17:02:14 +01:00 committed by Andreas Kling
parent f3b08ffc8a
commit 2dc96155f7

View file

@ -66,6 +66,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto& statusbar = *main_widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar");
statusbar.set_text(click_tip);
GUI::Application::the()->on_action_enter = [&statusbar](GUI::Action& action) {
statusbar.set_override_text(action.status_tip());
};
GUI::Application::the()->on_action_leave = [&statusbar](GUI::Action&) {
statusbar.set_override_text({});
};
auto& columns_spinbox = *main_widget->find_descendant_of_type_named<GUI::SpinBox>("columns_spinbox");
auto& rows_spinbox = *main_widget->find_descendant_of_type_named<GUI::SpinBox>("rows_spinbox");