diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-05 13:32:30 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-05 13:32:52 +0400 |
| commit | ae89b2e514fd4c22a38c2dce258707c369ca944a (patch) | |
| tree | 743448567dbc92843b46fc677b39336df3406a58 /src/ui/config_error_notification.rs | |
| parent | 732f7f6f33595924654d23a380cc2a48bf9f3257 (diff) | |
| download | niri-ae89b2e514fd4c22a38c2dce258707c369ca944a.tar.gz niri-ae89b2e514fd4c22a38c2dce258707c369ca944a.tar.bz2 niri-ae89b2e514fd4c22a38c2dce258707c369ca944a.zip | |
Implement spring animations
Diffstat (limited to 'src/ui/config_error_notification.rs')
| -rw-r--r-- | src/ui/config_error_notification.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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; } } |
