1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 05:15:06 +00:00

LibWeb: Add Page context menu request

Pages can request a context menu on right click. This is plumbed
through the PageClient.
This commit is contained in:
Andrew Kaster 2020-06-27 14:21:58 -06:00 committed by Andreas Kling
parent d28a824d4c
commit cc675cbe24
4 changed files with 12 additions and 0 deletions

View file

@ -103,6 +103,12 @@ void PageView::page_did_request_cursor_change(GUI::StandardCursor cursor)
window()->set_override_cursor(cursor);
}
void PageView::page_did_request_context_menu(const Gfx::IntPoint& content_position)
{
if (on_context_menu_request)
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
}
void PageView::page_did_request_link_context_menu(const Gfx::IntPoint& content_position, const String& href, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers)
{
if (on_link_context_menu_request)