mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
Browser: Pop up a context menu when one is requested on a tab
Currently, the tab's context menu only has options to reload and close, but this patch allows for those options to be quickly expanded!
This commit is contained in:
parent
bf2e6325a4
commit
9241c3a957
Notes:
sideshowbarker
2024-07-19 06:16:24 +09:00
Author: https://github.com/FalseHonesty
Commit: 9241c3a957
Pull-request: https://github.com/SerenityOS/serenity/pull/2291
Reviewed-by: https://github.com/awesomekling
3 changed files with 21 additions and 0 deletions
|
@ -121,6 +121,11 @@ int main(int argc, char** argv)
|
|||
tab.on_tab_close_request(tab);
|
||||
};
|
||||
|
||||
tab_widget.on_context_menu_request = [&](auto& clicked_widget, const GUI::ContextMenuEvent& context_menu_event) {
|
||||
auto& tab = static_cast<Browser::Tab&>(clicked_widget);
|
||||
tab.context_menu_requested(context_menu_event.screen_position());
|
||||
};
|
||||
|
||||
Browser::WindowActions window_actions(*window);
|
||||
|
||||
Function<void(URL url, bool activate)> create_new_tab;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue