mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +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:
parent
b937ebd121
commit
47dba83d30
3 changed files with 43 additions and 2 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue