mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb: Add hook when a link is middle clicked
This commit is contained in:
parent
9dbab2d05e
commit
0e048f3c4c
Notes:
sideshowbarker
2024-07-19 06:55:39 +09:00
Author: https://github.com/FalseHonesty 🔰 Commit: https://github.com/SerenityOS/serenity/commit/0e048f3c4c9 Pull-request: https://github.com/SerenityOS/serenity/pull/2137
2 changed files with 4 additions and 0 deletions
|
@ -244,6 +244,9 @@ void HtmlView::mousedown_event(GUI::MouseEvent& event)
|
|||
} else if (event.button() == GUI::MouseButton::Right) {
|
||||
if (on_link_context_menu_request)
|
||||
on_link_context_menu_request(link->href(), event.position().translated(screen_relative_rect().location()));
|
||||
} else if (event.button() == GUI::MouseButton::Middle) {
|
||||
if (on_link_middle_click)
|
||||
on_link_middle_click(link->href());
|
||||
}
|
||||
} else {
|
||||
if (event.button() == GUI::MouseButton::Left) {
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
|
||||
Function<void(const String& href, const String& target, unsigned modifiers)> on_link_click;
|
||||
Function<void(const String& href, const Gfx::Point& screen_position)> on_link_context_menu_request;
|
||||
Function<void(const String& href)> on_link_middle_click;
|
||||
Function<void(const String&)> on_link_hover;
|
||||
Function<void(const String&)> on_title_change;
|
||||
Function<void(const URL&)> on_load_start;
|
||||
|
|
Loading…
Add table
Reference in a new issue