mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:37:47 +00:00
LibWeb+WebContent: Support displaying tooltips in OOPWV
This commit is contained in:
parent
c503047c71
commit
5b617df496
7 changed files with 39 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "WebContentClient.h"
|
||||
#include <AK/String.h>
|
||||
#include <AK/URLParser.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -255,6 +256,16 @@ void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebCo
|
|||
scroll_into_view(rect, true, true);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_enter_tooltip_area(Badge<WebContentClient>, const Gfx::IntPoint&, const String& title)
|
||||
{
|
||||
GUI::Application::the()->show_tooltip(title, nullptr);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_leave_tooltip_area(Badge<WebContentClient>)
|
||||
{
|
||||
GUI::Application::the()->hide_tooltip();
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_hover_link(Badge<WebContentClient>, const URL& url)
|
||||
{
|
||||
if (on_link_hover)
|
||||
|
|
|
@ -62,6 +62,8 @@ public:
|
|||
void notify_server_did_change_title(Badge<WebContentClient>, const String&);
|
||||
void notify_server_did_request_scroll(Badge<WebContentClient>, int);
|
||||
void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect&);
|
||||
void notify_server_did_enter_tooltip_area(Badge<WebContentClient>, const Gfx::IntPoint&, const String&);
|
||||
void notify_server_did_leave_tooltip_area(Badge<WebContentClient>);
|
||||
void notify_server_did_hover_link(Badge<WebContentClient>, const URL&);
|
||||
void notify_server_did_unhover_link(Badge<WebContentClient>);
|
||||
void notify_server_did_click_link(Badge<WebContentClient>, const URL&, const String& target, unsigned modifiers);
|
||||
|
|
|
@ -106,6 +106,16 @@ void WebContentClient::handle(const Messages::WebContentClient::DidRequestScroll
|
|||
m_view.notify_server_did_request_scroll_into_view({}, message.rect());
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidEnterTooltipArea& message)
|
||||
{
|
||||
m_view.notify_server_did_enter_tooltip_area({}, message.content_position(), message.title());
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidLeaveTooltipArea&)
|
||||
{
|
||||
m_view.notify_server_did_leave_tooltip_area({});
|
||||
}
|
||||
|
||||
void WebContentClient::handle(const Messages::WebContentClient::DidHoverLink& message)
|
||||
{
|
||||
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidHoverLink! url={}", message.url());
|
||||
|
|
|
@ -59,6 +59,8 @@ private:
|
|||
virtual void handle(const Messages::WebContentClient::DidChangeTitle&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestScroll&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidRequestScrollIntoView&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidEnterTooltipArea&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidLeaveTooltipArea&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidHoverLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidUnhoverLink&) override;
|
||||
virtual void handle(const Messages::WebContentClient::DidClickLink&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue