layout: Add Column::advance_animations()
Browse files at this commit68752db51be61a1107eb8ad07ac7f41748816a50Parent: d4929b81 changed file +9 -6
- src/layout/workspace.rs +9 -6
src/layout/workspace.rsmodified+9 -6
| @@ -224,12 +224,8 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | for (col_idx, col) in self.columns.iter_mut().enumerate() { | 226 | for (col_idx, col) in self.columns.iter_mut().enumerate() { |
| 227 | - for (tile_idx, tile) in col.tiles.iter_mut().enumerate() { | 227 | + let is_active = is_active && col_idx == self.active_column_idx; |
| 228 | - let is_active = is_active | 228 | + col.advance_animations(current_time, is_active); |
| 229 | - && col_idx == self.active_column_idx | ||
| 230 | - && tile_idx == col.active_tile_idx; | ||
| 231 | - tile.advance_animations(current_time, is_active); | ||
| 232 | - } | ||
| 233 | } | 229 | } |
| 234 | } | 230 | } |
| 235 | 231 | ||
| @@ -1241,6 +1237,13 @@ impl<W: LayoutElement> Column<W> { | |||
| 1241 | self.update_tile_sizes(); | 1237 | self.update_tile_sizes(); |
| 1242 | } | 1238 | } |
| 1243 | 1239 | ||
| 1240 | + pub fn advance_animations(&mut self, current_time: Duration, is_active: bool) { | ||
| 1241 | + for (tile_idx, tile) in self.tiles.iter_mut().enumerate() { | ||
| 1242 | + let is_active = is_active && tile_idx == self.active_tile_idx; | ||
| 1243 | + tile.advance_animations(current_time, is_active); | ||
| 1244 | + } | ||
| 1245 | + } | ||
| 1246 | + | ||
| 1244 | pub fn contains(&self, window: &W) -> bool { | 1247 | pub fn contains(&self, window: &W) -> bool { |
| 1245 | self.tiles.iter().map(Tile::window).any(|win| win == window) | 1248 | self.tiles.iter().map(Tile::window).any(|win| win == window) |
| 1246 | } | 1249 | } |