diff --git a/Ladybird/WebView.cpp b/Ladybird/WebView.cpp index 4b04f4a6996..3f4805de428 100644 --- a/Ladybird/WebView.cpp +++ b/Ladybird/WebView.cpp @@ -182,15 +182,17 @@ public: { } - virtual void page_did_hover_link(AK::URL const&) override + virtual void page_did_hover_link(AK::URL const& url) override { + emit m_view.linkHovered(url.to_string().characters()); } virtual void page_did_unhover_link() override { + emit m_view.linkUnhovered(); } - virtual void page_did_invalidate(Gfx::IntRect const& rect) override + virtual void page_did_invalidate(Gfx::IntRect const&) override { m_view.viewport()->update(); } diff --git a/Ladybird/WebView.h b/Ladybird/WebView.h index 3e539f29267..5804d22344b 100644 --- a/Ladybird/WebView.h +++ b/Ladybird/WebView.h @@ -28,6 +28,10 @@ public: virtual void mousePressEvent(QMouseEvent*) override; virtual void mouseReleaseEvent(QMouseEvent*) override; +signals: + void linkHovered(QString, int timeout = 0); + void linkUnhovered(); + private: OwnPtr m_page_client; }; diff --git a/Ladybird/main.cpp b/Ladybird/main.cpp index 94f56d59065..2b87ee22c61 100644 --- a/Ladybird/main.cpp +++ b/Ladybird/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include extern void initialize_web_engine(); @@ -36,6 +37,9 @@ ErrorOr serenity_main(Main::Arguments arguments) WebView view; window.setCentralWidget(&view); + QObject::connect(&view, &WebView::linkHovered, window.statusBar(), &QStatusBar::showMessage); + QObject::connect(&view, &WebView::linkUnhovered, window.statusBar(), &QStatusBar::clearMessage); + auto qt_event_loop_driver = Core::Timer::create_repeating(50, [&] { app.processEvents(); });