Update tooltip code a bit

This fixes a tiny UX bug where the tooltip would appear to move if you
hovered over an element, then moved your mouse out and back within
500ms.

The fix is to retain the task, so we can drop it to cancel it when the
mouse leaves.

Also changes the time we construct the tooltip to the time it first
shows.
This commit is contained in:
Conrad Irwin 2023-11-03 21:40:28 -06:00
parent 4725cd2cd6
commit de5458cfe0
3 changed files with 32 additions and 35 deletions

View file

@ -1,5 +1,3 @@
use std::time::Duration;
use gpui2::{div, px, Div, ParentElement, Render, SharedString, Styled, ViewContext};
use theme2::ActiveTheme;