From dfe49aa70567fc48c0b34dccddc17fd907a6b60c Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 17 Apr 2024 14:29:22 +0400 Subject: Use movement anim for view anim during movement --- src/layout/workspace.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 89486272..01aca338 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -651,12 +651,24 @@ impl Workspace { } fn activate_column(&mut self, idx: usize) { + self.activate_column_with_anim_config( + idx, + self.options.animations.horizontal_view_movement.0, + ); + } + + fn activate_column_with_anim_config(&mut self, idx: usize, config: niri_config::Animation) { if self.active_column_idx == idx { return; } let current_x = self.view_pos(); - self.animate_view_offset_to_column(current_x, idx, Some(self.active_column_idx)); + self.animate_view_offset_to_column_with_config( + current_x, + idx, + Some(self.active_column_idx), + config, + ); self.active_column_idx = idx; @@ -1315,7 +1327,7 @@ impl Workspace { } } - self.activate_column(new_idx); + self.activate_column_with_anim_config(new_idx, self.options.animations.window_movement.0); } pub fn move_left(&mut self) { -- cgit