Skip to main content

gpui_animation/
lib.rs

1pub mod animation;
2pub mod transition;
3
4pub(crate) mod interpolate;
5
6/// Reset all animation state associated with the given element ID.
7///
8/// Call this before navigating away from a view that uses `transition_on_hover`
9/// so that stale hover state does not reappear when the element is re-rendered.
10///
11/// ```ignore
12/// .on_mouse_down(MouseButton::Left, move |_e, w, cx| {
13///     gpui_animation::reset_transition(&ElementId::Name("my-row".into()));
14///     on_click(w, cx);
15/// })
16/// ```
17pub fn reset_transition(id: &gpui::ElementId) {
18    transition::TransitionRegistry::reset_state(id);
19}