mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibHTML+Browser: Show target URL of hovered links in Browser statusbar
HtmlView will now invoke the on_link_hover hook when the cursor enters or leaves a DOM node that has an enclosing link element. This patch also updates the meaning of Node::enclosing_link_element() to find the nearest HTMLAnchorElementAncestor *with an href attribute*.
This commit is contained in:
@@ -105,6 +105,10 @@ int main(int argc, char** argv)
|
||||
|
||||
auto statusbar = GStatusBar::construct(widget);
|
||||
|
||||
html_widget->on_link_hover = [&](auto& href) {
|
||||
statusbar->set_text(href);
|
||||
};
|
||||
|
||||
ResourceLoader::the().on_load_counter_change = [&] {
|
||||
if (ResourceLoader::the().pending_loads() == 0) {
|
||||
statusbar->set_text("");
|
||||
|
||||
Reference in New Issue
Block a user