From ae89b2e514fd4c22a38c2dce258707c369ca944a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 5 Mar 2024 13:32:30 +0400 Subject: Implement spring animations --- src/ui/config_error_notification.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui/config_error_notification.rs') diff --git a/src/ui/config_error_notification.rs b/src/ui/config_error_notification.rs index 12d92b85..b9e68e8e 100644 --- a/src/ui/config_error_notification.rs +++ b/src/ui/config_error_notification.rs @@ -62,6 +62,7 @@ impl ConfigErrorNotification { Animation::new( from, to, + 0., c.animations.config_notification_open_close, niri_config::Animation::default_config_notification_open_close(), ) @@ -118,7 +119,9 @@ impl ConfigErrorNotification { } State::Hiding(anim) => { anim.set_current_time(target_presentation_time); - if anim.is_done() { + // HACK: prevent bounciness on hiding. This is better done with a clamp property on + // the spring animation. + if anim.is_done() || anim.value() <= 0. { self.state = State::Hidden; } } -- cgit