feat: add window animations
This commit is contained in:
parent
eece44a59c
commit
2a079ed800
29 changed files with 6957 additions and 114 deletions
|
|
@ -266,6 +266,20 @@ pub struct UiDrag {
|
|||
pub threshold: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct Animations {
|
||||
pub enabled: Option<bool>,
|
||||
pub duration_ms: Option<u32>,
|
||||
pub style: Option<String>,
|
||||
pub curve: Option<AnimationCurveConfig>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum AnimationCurveConfig {
|
||||
Preset(String),
|
||||
CubicBezier([f32; 4]),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum OutputMatch {
|
||||
Any(Vec<OutputMatch>),
|
||||
|
|
@ -569,6 +583,7 @@ pub struct Config {
|
|||
pub tearing: Option<Tearing>,
|
||||
pub libei: Libei,
|
||||
pub ui_drag: UiDrag,
|
||||
pub animations: Animations,
|
||||
pub xwayland: Option<Xwayland>,
|
||||
pub color_management: Option<ColorManagement>,
|
||||
pub float: Option<Float>,
|
||||
|
|
@ -653,3 +668,26 @@ fn default_config_parses() {
|
|||
let input = include_bytes!("default-config.toml");
|
||||
parse_config(input, &Default::default(), |_| ()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn custom_animation_curve_parses() {
|
||||
let input = b"
|
||||
[animations]
|
||||
curve = [0.25, 0.1, 0.25, 1.0]
|
||||
";
|
||||
let config = parse_config(input, &Default::default(), |_| ()).unwrap();
|
||||
assert_eq!(
|
||||
config.animations.curve,
|
||||
Some(AnimationCurveConfig::CubicBezier([0.25, 0.1, 0.25, 1.0]))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn animation_style_parses() {
|
||||
let input = b"
|
||||
[animations]
|
||||
style = \"plain\"
|
||||
";
|
||||
let config = parse_config(input, &Default::default(), |_| ()).unwrap();
|
||||
assert_eq!(config.animations.style.as_deref(), Some("plain"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue