1
0
Fork 0
forked from wry/wry

Add animation style toggle

This commit is contained in:
atagen 2026-05-27 22:52:06 +10:00
parent 02222d5189
commit e7f9a5cb09
15 changed files with 238 additions and 20 deletions

View file

@ -1035,6 +1035,10 @@ impl ConfigClient {
self.send(&ClientMessage::SetAnimationCurve { curve });
}
pub fn set_animation_style(&self, style: u32) {
self.send(&ClientMessage::SetAnimationStyle { style });
}
pub fn set_animation_cubic_bezier(&self, x1: f32, y1: f32, x2: f32, y2: f32) {
self.send(&ClientMessage::SetAnimationCubicBezier { x1, y1, x2, y2 });
}

View file

@ -554,6 +554,9 @@ pub enum ClientMessage<'a> {
SetAnimationCurve {
curve: u32,
},
SetAnimationStyle {
style: u32,
},
SetAnimationCubicBezier {
x1: f32,
y1: f32,

View file

@ -115,6 +115,15 @@ impl AnimationCurve {
pub const EASE_IN_OUT: Self = Self(4);
}
/// The presentation style used for tiled window movement animations.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct AnimationStyle(pub u32);
impl AnimationStyle {
pub const PLAIN: Self = Self(0);
pub const MULTIPHASE: Self = Self(1);
}
/// Exits the compositor.
pub fn quit() {
get!().quit()
@ -320,6 +329,13 @@ pub fn set_animation_curve(curve: AnimationCurve) {
get!().set_animation_curve(curve.0);
}
/// Sets the presentation style used for tiled window movement animations.
///
/// The default is [`AnimationStyle::MULTIPHASE`].
pub fn set_animation_style(style: AnimationStyle) {
get!().set_animation_style(style.0);
}
/// Sets a custom cubic-bezier curve used by tiled window animations.
///
/// `x1` and `x2` must be between `0.0` and `1.0`. The curve starts at `(0, 0)`