LibWeb+UI/Qt: Display 'title' tooltips only when the mouse stops moving

Now instead of sending the position in which the user entered the
tooltip area, send just the text, and let the chrome figure out how to
display it.

In the case of Qt, wait for 600 milliseconds of no mouse movement, then
display it under the mouse cursor.
This commit is contained in:
circl 2024-07-02 14:16:24 +02:00 committed by Andreas Kling
parent 6623177265
commit 0f7623dd83
Notes: sideshowbarker 2024-07-17 08:43:11 +09:00
12 changed files with 34 additions and 21 deletions

View file

@ -170,11 +170,11 @@ void WebContentClient::did_change_url(u64 page_id, URL::URL const& url)
}
}
void WebContentClient::did_enter_tooltip_area(u64 page_id, Gfx::IntPoint content_position, ByteString const& title)
void WebContentClient::did_enter_tooltip_area(u64 page_id, ByteString const& title)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_enter_tooltip_area)
view->on_enter_tooltip_area(view->to_widget_position(content_position), title);
view->on_enter_tooltip_area(title);
}
}