mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
config: Rearrange animations in struct
This commit is contained in:
+50
-50
@@ -486,14 +486,14 @@ pub struct Animations {
|
|||||||
#[knuffel(child, default)]
|
#[knuffel(child, default)]
|
||||||
pub workspace_switch: WorkspaceSwitchAnim,
|
pub workspace_switch: WorkspaceSwitchAnim,
|
||||||
#[knuffel(child, default)]
|
#[knuffel(child, default)]
|
||||||
pub horizontal_view_movement: HorizontalViewMovementAnim,
|
|
||||||
#[knuffel(child, default)]
|
|
||||||
pub window_movement: WindowMovementAnim,
|
|
||||||
#[knuffel(child, default)]
|
|
||||||
pub window_open: WindowOpenAnim,
|
pub window_open: WindowOpenAnim,
|
||||||
#[knuffel(child, default)]
|
#[knuffel(child, default)]
|
||||||
pub window_close: WindowCloseAnim,
|
pub window_close: WindowCloseAnim,
|
||||||
#[knuffel(child, default)]
|
#[knuffel(child, default)]
|
||||||
|
pub horizontal_view_movement: HorizontalViewMovementAnim,
|
||||||
|
#[knuffel(child, default)]
|
||||||
|
pub window_movement: WindowMovementAnim,
|
||||||
|
#[knuffel(child, default)]
|
||||||
pub window_resize: WindowResizeAnim,
|
pub window_resize: WindowResizeAnim,
|
||||||
#[knuffel(child, default)]
|
#[knuffel(child, default)]
|
||||||
pub config_notification_open_close: ConfigNotificationOpenCloseAnim,
|
pub config_notification_open_close: ConfigNotificationOpenCloseAnim,
|
||||||
@@ -531,6 +531,36 @@ impl Default for WorkspaceSwitchAnim {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
pub struct WindowOpenAnim(pub Animation);
|
||||||
|
|
||||||
|
impl Default for WindowOpenAnim {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self(Animation {
|
||||||
|
off: false,
|
||||||
|
kind: AnimationKind::Easing(EasingParams {
|
||||||
|
duration_ms: 150,
|
||||||
|
curve: AnimationCurve::EaseOutExpo,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
pub struct WindowCloseAnim(pub Animation);
|
||||||
|
|
||||||
|
impl Default for WindowCloseAnim {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self(Animation {
|
||||||
|
off: false,
|
||||||
|
kind: AnimationKind::Easing(EasingParams {
|
||||||
|
duration_ms: 150,
|
||||||
|
curve: AnimationCurve::EaseOutQuad,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct HorizontalViewMovementAnim(pub Animation);
|
pub struct HorizontalViewMovementAnim(pub Animation);
|
||||||
|
|
||||||
@@ -563,52 +593,6 @@ impl Default for WindowMovementAnim {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
||||||
pub struct ConfigNotificationOpenCloseAnim(pub Animation);
|
|
||||||
|
|
||||||
impl Default for ConfigNotificationOpenCloseAnim {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self(Animation {
|
|
||||||
off: false,
|
|
||||||
kind: AnimationKind::Spring(SpringParams {
|
|
||||||
damping_ratio: 0.6,
|
|
||||||
stiffness: 1000,
|
|
||||||
epsilon: 0.001,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
||||||
pub struct WindowOpenAnim(pub Animation);
|
|
||||||
|
|
||||||
impl Default for WindowOpenAnim {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self(Animation {
|
|
||||||
off: false,
|
|
||||||
kind: AnimationKind::Easing(EasingParams {
|
|
||||||
duration_ms: 150,
|
|
||||||
curve: AnimationCurve::EaseOutExpo,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
||||||
pub struct WindowCloseAnim(pub Animation);
|
|
||||||
|
|
||||||
impl Default for WindowCloseAnim {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self(Animation {
|
|
||||||
off: false,
|
|
||||||
kind: AnimationKind::Easing(EasingParams {
|
|
||||||
duration_ms: 150,
|
|
||||||
curve: AnimationCurve::EaseOutQuad,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct WindowResizeAnim(pub Animation);
|
pub struct WindowResizeAnim(pub Animation);
|
||||||
|
|
||||||
@@ -625,6 +609,22 @@ impl Default for WindowResizeAnim {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
pub struct ConfigNotificationOpenCloseAnim(pub Animation);
|
||||||
|
|
||||||
|
impl Default for ConfigNotificationOpenCloseAnim {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self(Animation {
|
||||||
|
off: false,
|
||||||
|
kind: AnimationKind::Spring(SpringParams {
|
||||||
|
damping_ratio: 0.6,
|
||||||
|
stiffness: 1000,
|
||||||
|
epsilon: 0.001,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Animation {
|
pub struct Animation {
|
||||||
pub off: bool,
|
pub off: bool,
|
||||||
|
|||||||
Reference in New Issue
Block a user