config: Rearrange animations in struct
Browse files at this commit65c342f2cb814df4fb6e15123c919084d5465240Parent: 47f6c851 changed file +36 -36
- niri-config/src/lib.rs +36 -36
niri-config/src/lib.rsmodified+36 -36
| @@ -486,14 +486,14 @@ pub struct Animations { | |||
| 486 | #[knuffel(child, default)] | 486 | #[knuffel(child, default)] |
| 487 | pub workspace_switch: WorkspaceSwitchAnim, | 487 | pub workspace_switch: WorkspaceSwitchAnim, |
| 488 | #[knuffel(child, default)] | 488 | #[knuffel(child, default)] |
| 489 | - pub horizontal_view_movement: HorizontalViewMovementAnim, | ||
| 490 | - #[knuffel(child, default)] | ||
| 491 | - pub window_movement: WindowMovementAnim, | ||
| 492 | - #[knuffel(child, default)] | ||
| 493 | pub window_open: WindowOpenAnim, | 489 | pub window_open: WindowOpenAnim, |
| 494 | #[knuffel(child, default)] | 490 | #[knuffel(child, default)] |
| 495 | pub window_close: WindowCloseAnim, | 491 | pub window_close: WindowCloseAnim, |
| 496 | #[knuffel(child, default)] | 492 | #[knuffel(child, default)] |
| 493 | + pub horizontal_view_movement: HorizontalViewMovementAnim, | ||
| 494 | + #[knuffel(child, default)] | ||
| 495 | + pub window_movement: WindowMovementAnim, | ||
| 496 | + #[knuffel(child, default)] | ||
| 497 | pub window_resize: WindowResizeAnim, | 497 | pub window_resize: WindowResizeAnim, |
| 498 | #[knuffel(child, default)] | 498 | #[knuffel(child, default)] |
| 499 | pub config_notification_open_close: ConfigNotificationOpenCloseAnim, | 499 | pub config_notification_open_close: ConfigNotificationOpenCloseAnim, |
| @@ -532,94 +532,94 @@ impl Default for WorkspaceSwitchAnim { | |||
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | #[derive(Debug, Clone, Copy, PartialEq)] | 534 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 535 | -pub struct HorizontalViewMovementAnim(pub Animation); | 535 | +pub struct WindowOpenAnim(pub Animation); |
| 536 | 536 | ||
| 537 | -impl Default for HorizontalViewMovementAnim { | 537 | +impl Default for WindowOpenAnim { |
| 538 | fn default() -> Self { | 538 | fn default() -> Self { |
| 539 | Self(Animation { | 539 | Self(Animation { |
| 540 | off: false, | 540 | off: false, |
| 541 | - kind: AnimationKind::Spring(SpringParams { | 541 | + kind: AnimationKind::Easing(EasingParams { |
| 542 | - damping_ratio: 1., | 542 | + duration_ms: 150, |
| 543 | - stiffness: 800, | 543 | + curve: AnimationCurve::EaseOutExpo, |
| 544 | - epsilon: 0.0001, | ||
| 545 | }), | 544 | }), |
| 546 | }) | 545 | }) |
| 547 | } | 546 | } |
| 548 | } | 547 | } |
| 549 | 548 | ||
| 550 | #[derive(Debug, Clone, Copy, PartialEq)] | 549 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 551 | -pub struct WindowMovementAnim(pub Animation); | 550 | +pub struct WindowCloseAnim(pub Animation); |
| 552 | 551 | ||
| 553 | -impl Default for WindowMovementAnim { | 552 | +impl Default for WindowCloseAnim { |
| 554 | fn default() -> Self { | 553 | fn default() -> Self { |
| 555 | Self(Animation { | 554 | Self(Animation { |
| 556 | off: false, | 555 | off: false, |
| 557 | - kind: AnimationKind::Spring(SpringParams { | 556 | + kind: AnimationKind::Easing(EasingParams { |
| 558 | - damping_ratio: 1., | 557 | + duration_ms: 150, |
| 559 | - stiffness: 800, | 558 | + curve: AnimationCurve::EaseOutQuad, |
| 560 | - epsilon: 0.0001, | ||
| 561 | }), | 559 | }), |
| 562 | }) | 560 | }) |
| 563 | } | 561 | } |
| 564 | } | 562 | } |
| 565 | 563 | ||
| 566 | #[derive(Debug, Clone, Copy, PartialEq)] | 564 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 567 | -pub struct ConfigNotificationOpenCloseAnim(pub Animation); | 565 | +pub struct HorizontalViewMovementAnim(pub Animation); |
| 568 | 566 | ||
| 569 | -impl Default for ConfigNotificationOpenCloseAnim { | 567 | +impl Default for HorizontalViewMovementAnim { |
| 570 | fn default() -> Self { | 568 | fn default() -> Self { |
| 571 | Self(Animation { | 569 | Self(Animation { |
| 572 | off: false, | 570 | off: false, |
| 573 | kind: AnimationKind::Spring(SpringParams { | 571 | kind: AnimationKind::Spring(SpringParams { |
| 574 | - damping_ratio: 0.6, | 572 | + damping_ratio: 1., |
| 575 | - stiffness: 1000, | 573 | + stiffness: 800, |
| 576 | - epsilon: 0.001, | 574 | + epsilon: 0.0001, |
| 577 | }), | 575 | }), |
| 578 | }) | 576 | }) |
| 579 | } | 577 | } |
| 580 | } | 578 | } |
| 581 | 579 | ||
| 582 | #[derive(Debug, Clone, Copy, PartialEq)] | 580 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 583 | -pub struct WindowOpenAnim(pub Animation); | 581 | +pub struct WindowMovementAnim(pub Animation); |
| 584 | 582 | ||
| 585 | -impl Default for WindowOpenAnim { | 583 | +impl Default for WindowMovementAnim { |
| 586 | fn default() -> Self { | 584 | fn default() -> Self { |
| 587 | Self(Animation { | 585 | Self(Animation { |
| 588 | off: false, | 586 | off: false, |
| 589 | - kind: AnimationKind::Easing(EasingParams { | 587 | + kind: AnimationKind::Spring(SpringParams { |
| 590 | - duration_ms: 150, | 588 | + damping_ratio: 1., |
| 591 | - curve: AnimationCurve::EaseOutExpo, | 589 | + stiffness: 800, |
| 590 | + epsilon: 0.0001, | ||
| 592 | }), | 591 | }), |
| 593 | }) | 592 | }) |
| 594 | } | 593 | } |
| 595 | } | 594 | } |
| 596 | 595 | ||
| 597 | #[derive(Debug, Clone, Copy, PartialEq)] | 596 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 598 | -pub struct WindowCloseAnim(pub Animation); | 597 | +pub struct WindowResizeAnim(pub Animation); |
| 599 | 598 | ||
| 600 | -impl Default for WindowCloseAnim { | 599 | +impl Default for WindowResizeAnim { |
| 601 | fn default() -> Self { | 600 | fn default() -> Self { |
| 602 | Self(Animation { | 601 | Self(Animation { |
| 603 | off: false, | 602 | off: false, |
| 604 | - kind: AnimationKind::Easing(EasingParams { | 603 | + kind: AnimationKind::Spring(SpringParams { |
| 605 | - duration_ms: 150, | 604 | + damping_ratio: 1., |
| 606 | - curve: AnimationCurve::EaseOutQuad, | 605 | + stiffness: 800, |
| 606 | + epsilon: 0.0001, | ||
| 607 | }), | 607 | }), |
| 608 | }) | 608 | }) |
| 609 | } | 609 | } |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | #[derive(Debug, Clone, Copy, PartialEq)] | 612 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 613 | -pub struct WindowResizeAnim(pub Animation); | 613 | +pub struct ConfigNotificationOpenCloseAnim(pub Animation); |
| 614 | 614 | ||
| 615 | -impl Default for WindowResizeAnim { | 615 | +impl Default for ConfigNotificationOpenCloseAnim { |
| 616 | fn default() -> Self { | 616 | fn default() -> Self { |
| 617 | Self(Animation { | 617 | Self(Animation { |
| 618 | off: false, | 618 | off: false, |
| 619 | kind: AnimationKind::Spring(SpringParams { | 619 | kind: AnimationKind::Spring(SpringParams { |
| 620 | - damping_ratio: 1., | 620 | + damping_ratio: 0.6, |
| 621 | - stiffness: 800, | 621 | + stiffness: 1000, |
| 622 | - epsilon: 0.0001, | 622 | + epsilon: 0.001, |
| 623 | }), | 623 | }), |
| 624 | }) | 624 | }) |
| 625 | } | 625 | } |