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