diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-06 19:52:47 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-06 19:52:47 +0400 |
| commit | 68752db51be61a1107eb8ad07ac7f41748816a50 (patch) | |
| tree | 7cba2db4109cdf8bb23796ac9e77a1caecf9e103 /src/layout | |
| parent | d4929b8e18fb500aac515e98ab06afdf433ace23 (diff) | |
| download | niri-68752db51be61a1107eb8ad07ac7f41748816a50.tar.gz niri-68752db51be61a1107eb8ad07ac7f41748816a50.tar.bz2 niri-68752db51be61a1107eb8ad07ac7f41748816a50.zip | |
layout: Add Column::advance_animations()
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/workspace.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index bf54c6d3..6e2a7c00 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -224,12 +224,8 @@ impl<W: LayoutElement> Workspace<W> { } for (col_idx, col) in self.columns.iter_mut().enumerate() { - for (tile_idx, tile) in col.tiles.iter_mut().enumerate() { - let is_active = is_active - && col_idx == self.active_column_idx - && tile_idx == col.active_tile_idx; - tile.advance_animations(current_time, is_active); - } + let is_active = is_active && col_idx == self.active_column_idx; + col.advance_animations(current_time, is_active); } } @@ -1241,6 +1237,13 @@ impl<W: LayoutElement> Column<W> { self.update_tile_sizes(); } + pub fn advance_animations(&mut self, current_time: Duration, is_active: bool) { + for (tile_idx, tile) in self.tiles.iter_mut().enumerate() { + let is_active = is_active && tile_idx == self.active_tile_idx; + tile.advance_animations(current_time, is_active); + } + } + pub fn contains(&self, window: &W) -> bool { self.tiles.iter().map(Tile::window).any(|win| win == window) } |
