mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Implement window resize animations
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user