mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
MasterWord: Show status tips in Statusbar
This commit is contained in:
parent
2dc96155f7
commit
46f365df5c
1 changed files with 6 additions and 0 deletions
|
@ -51,6 +51,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(main_widget->load_from_gml(master_word_gml));
|
||||
auto& game = *main_widget->find_descendant_of_type_named<MasterWord::WordGame>("word_game");
|
||||
auto& statusbar = *main_widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar");
|
||||
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 use_system_theme = Config::read_bool("MasterWord"sv, ""sv, "use_system_theme"sv, false);
|
||||
game.set_use_system_theme(use_system_theme);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue