Use movement anim for view anim during movement
Browse files at this commitdfe49aa70567fc48c0b34dccddc17fd907a6b60cParent: 7ca39ba1 changed file +14 -2
- src/layout/workspace.rs +14 -2
src/layout/workspace.rsmodified+14 -2
| @@ -651,12 +651,24 @@ impl<W: LayoutElement> Workspace<W> { | ||
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | fn activate_column(&mut self, idx: usize) { |
| 654 | + self.activate_column_with_anim_config( | |
| 655 | + idx, | |
| 656 | + self.options.animations.horizontal_view_movement.0, | |
| 657 | + ); | |
| 658 | + } | |
| 659 | + | |
| 660 | + fn activate_column_with_anim_config(&mut self, idx: usize, config: niri_config::Animation) { | |
| 654 | 661 | if self.active_column_idx == idx { |
| 655 | 662 | return; |
| 656 | 663 | } |
| 657 | 664 | |
| 658 | 665 | let current_x = self.view_pos(); |
| 659 | - self.animate_view_offset_to_column(current_x, idx, Some(self.active_column_idx)); | |
| 666 | + self.animate_view_offset_to_column_with_config( | |
| 667 | + current_x, | |
| 668 | + idx, | |
| 669 | + Some(self.active_column_idx), | |
| 670 | + config, | |
| 671 | + ); | |
| 660 | 672 | |
| 661 | 673 | self.active_column_idx = idx; |
| 662 | 674 | |
| @@ -1315,7 +1327,7 @@ impl<W: LayoutElement> Workspace<W> { | ||
| 1315 | 1327 | } |
| 1316 | 1328 | } |
| 1317 | 1329 | |
| 1318 | - self.activate_column(new_idx); | |
| 1330 | + self.activate_column_with_anim_config(new_idx, self.options.animations.window_movement.0); | |
| 1319 | 1331 | } |
| 1320 | 1332 | |
| 1321 | 1333 | pub fn move_left(&mut self) { |