1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 10:14:58 +00:00

LibGUI: Show tooltip after a small delay

It always felt a bit jarring that tooltips would pop in right away when
you hover over a toolbar button. This patch adds a 700ms delay before
they appear, and a 50ms delay before they disappear.

Once a tooltip is up, moving the cursor between two widgets that both
have tooltips will leave the tooltip on screen without delays.
This commit is contained in:
Andreas Kling 2020-12-28 21:26:47 +01:00
parent 3717e5dbae
commit 7e79563bb9
4 changed files with 84 additions and 51 deletions

View file

@ -201,9 +201,9 @@ void InProcessWebView::page_did_middle_click_link(const URL& url, const String&
on_link_middle_click(url, target, modifiers);
}
void InProcessWebView::page_did_enter_tooltip_area(const Gfx::IntPoint& content_position, const String& title)
void InProcessWebView::page_did_enter_tooltip_area([[maybe_unused]] const Gfx::IntPoint& content_position, const String& title)
{
GUI::Application::the()->show_tooltip(title, screen_relative_rect().location().translated(to_widget_position(content_position)), nullptr);
GUI::Application::the()->show_tooltip(title, nullptr);
}
void InProcessWebView::page_did_leave_tooltip_area()