1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

Browser: Display full UserAgent string in status bar on menu hover

This uses the new on_action_enter & on_action_leave APIs to display
the full useragent string when hovering over one of the useragent
spoof menu options.
This commit is contained in:
Idan Horowitz 2021-04-17 23:08:06 +03:00 committed by Linus Groh
parent b937ebd121
commit 47dba83d30
3 changed files with 43 additions and 2 deletions

View file

@ -248,6 +248,20 @@ int main(int argc, char** argv)
}
}
app->on_action_enter = [&](GUI::Action& action) {
auto* tab = static_cast<Browser::Tab*>(tab_widget.active_widget());
if (!tab)
return;
tab->action_entered(action);
};
app->on_action_leave = [&](auto& action) {
auto* tab = static_cast<Browser::Tab*>(tab_widget.active_widget());
if (!tab)
return;
tab->action_left(action);
};
window_actions.on_create_new_tab = [&] {
create_new_tab(Browser::g_home_url, true);
};