diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-17 14:06:32 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-04-17 14:06:32 +0400 |
| commit | 73e9ef5fe20825ed12f1bb05ba10e7eb69bc7662 (patch) | |
| tree | cdb4d408a50494fd86695ce0807602869c047f93 /src/layout/tile.rs | |
| parent | c40d4f3268318ac295f21bfce38b9809c5e48f0d (diff) | |
| download | niri-73e9ef5fe20825ed12f1bb05ba10e7eb69bc7662.tar.gz niri-73e9ef5fe20825ed12f1bb05ba10e7eb69bc7662.tar.bz2 niri-73e9ef5fe20825ed12f1bb05ba10e7eb69bc7662.zip | |
Resolve animation defaults during parsing
Diffstat (limited to 'src/layout/tile.rs')
| -rw-r--r-- | src/layout/tile.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/layout/tile.rs b/src/layout/tile.rs index 87c168b0..16779c10 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -150,13 +150,7 @@ impl<W: LayoutElement> Tile<W> { let change = self.window.size().to_point() - size_from.to_point(); let change = max(change.x.abs(), change.y.abs()); if change > RESIZE_ANIMATION_THRESHOLD { - let anim = Animation::new( - 0., - 1., - 0., - self.options.animations.window_resize, - niri_config::Animation::default_window_resize(), - ); + let anim = Animation::new(0., 1., 0., self.options.animations.window_resize.0); self.resize_animation = Some(ResizeAnimation { anim, size_from, @@ -230,8 +224,7 @@ impl<W: LayoutElement> Tile<W> { 0., 1., 0., - self.options.animations.window_open, - niri_config::Animation::default_window_open(), + self.options.animations.window_open.0, )); } @@ -244,23 +237,18 @@ impl<W: LayoutElement> Tile<W> { } pub fn animate_move_from(&mut self, from: Point<i32, Logical>) { - self.animate_move_from_with_config( - from, - self.options.animations.window_movement, - niri_config::Animation::default_window_movement(), - ); + self.animate_move_from_with_config(from, self.options.animations.window_movement.0); } pub fn animate_move_from_with_config( &mut self, from: Point<i32, Logical>, config: niri_config::Animation, - default: niri_config::Animation, ) { let current_offset = self.render_offset(); self.move_animation = Some(MoveAnimation { - anim: Animation::new(1., 0., 0., config, default), + anim: Animation::new(1., 0., 0., config), from: from + current_offset, }); } |
