layout: Add animate_move_from_with_config()
Browse files at this commitded793dc071f4b9013a109f8d4a6176c373607dfParent: 60a53622 changed files +20 -4
- src/layout/scrolling.rs +10 -2
- src/layout/tile.rs +10 -2
src/layout/scrolling.rsmodified+10 -2
| @@ -4203,8 +4203,16 @@ impl<W: LayoutElement> Column<W> { | ||
| 4203 | 4203 | } |
| 4204 | 4204 | |
| 4205 | 4205 | pub fn animate_move_from(&mut self, from: Point<f64, Logical>) { |
| 4206 | - self.animate_move_x_from(from.x); | |
| 4207 | - self.animate_move_y_from(from.y); | |
| 4206 | + self.animate_move_from_with_config(from, self.options.animations.window_movement.0); | |
| 4207 | + } | |
| 4208 | + | |
| 4209 | + pub fn animate_move_from_with_config( | |
| 4210 | + &mut self, | |
| 4211 | + from: Point<f64, Logical>, | |
| 4212 | + config: niri_config::Animation, | |
| 4213 | + ) { | |
| 4214 | + self.animate_move_x_from_with_config(from.x, config); | |
| 4215 | + self.animate_move_y_from_with_config(from.y, config); | |
| 4208 | 4216 | } |
| 4209 | 4217 | |
| 4210 | 4218 | pub fn animate_move_x_from(&mut self, from_x_offset: f64) { |
src/layout/tile.rsmodified+10 -2
| @@ -573,8 +573,16 @@ impl<W: LayoutElement> Tile<W> { | ||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | pub fn animate_move_from(&mut self, from: Point<f64, Logical>) { |
| 576 | - self.animate_move_x_from(from.x); | |
| 577 | - self.animate_move_y_from(from.y); | |
| 576 | + self.animate_move_from_with_config(from, self.options.animations.window_movement.0); | |
| 577 | + } | |
| 578 | + | |
| 579 | + pub fn animate_move_from_with_config( | |
| 580 | + &mut self, | |
| 581 | + from: Point<f64, Logical>, | |
| 582 | + config: niri_config::Animation, | |
| 583 | + ) { | |
| 584 | + self.animate_move_x_from_with_config(from.x, config); | |
| 585 | + self.animate_move_y_from_with_config(from.y, config); | |
| 578 | 586 | } |
| 579 | 587 | |
| 580 | 588 | pub fn animate_move_x_from(&mut self, from: f64) { |