Implement window resize animations

This commit is contained in:
Ivan Molodetskikh
2024-04-13 11:07:23 +04:00
parent 4fd9300bdb
commit 71be19b234
21 changed files with 1433 additions and 89 deletions
+14
View File
@@ -489,6 +489,8 @@ pub struct Animations {
pub window_open: Animation,
#[knuffel(child, default = Animation::default_window_close())]
pub window_close: Animation,
#[knuffel(child, default = Animation::default_window_resize())]
pub window_resize: Animation,
#[knuffel(child, default = Animation::default_config_notification_open_close())]
pub config_notification_open_close: Animation,
}
@@ -503,6 +505,7 @@ impl Default for Animations {
window_movement: Animation::default_window_movement(),
window_open: Animation::default_window_open(),
window_close: Animation::default_window_close(),
window_resize: Animation::default_window_resize(),
config_notification_open_close: Animation::default_config_notification_open_close(),
}
}
@@ -592,6 +595,17 @@ impl Animation {
}),
}
}
pub const fn default_window_resize() -> Self {
Self {
off: false,
kind: AnimationKind::Spring(SpringParams {
damping_ratio: 1.,
stiffness: 800,
epsilon: 0.0001,
}),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]