layout: Use column.contains more
Browse files at this commit4dd7578fe7c55e4b3154b212d757632d173c76c2Parent: ea72e4d2 changed files +3 -3
- src/layout/mod.rs +1 -1
- src/layout/workspace.rs +2 -2
src/layout/mod.rsmodified+1 -1
| @@ -1088,7 +1088,7 @@ impl<W: LayoutElement> Layout<W> { | ||
| 1088 | 1088 | for mon in &*monitors { |
| 1089 | 1089 | for ws in &mon.workspaces { |
| 1090 | 1090 | for col in &ws.columns { |
| 1091 | - if col.windows.contains(&window) { | |
| 1091 | + if col.contains(&window) { | |
| 1092 | 1092 | width = Some(col.width); |
| 1093 | 1093 | is_full_width = col.is_full_width; |
| 1094 | 1094 | break; |
src/layout/workspace.rsmodified+2 -2
| @@ -855,7 +855,7 @@ impl<W: LayoutElement> Workspace<W> { | ||
| 855 | 855 | let col = self |
| 856 | 856 | .columns |
| 857 | 857 | .iter_mut() |
| 858 | - .find(|col| col.windows.contains(window)) | |
| 858 | + .find(|col| col.contains(window)) | |
| 859 | 859 | .unwrap(); |
| 860 | 860 | let value = !col.is_fullscreen; |
| 861 | 861 | self.set_fullscreen(window, value); |
| @@ -1023,7 +1023,7 @@ impl<W: LayoutElement> Column<W> { | ||
| 1023 | 1023 | self.update_window_sizes(); |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | - fn contains(&self, window: &W) -> bool { | |
| 1026 | + pub fn contains(&self, window: &W) -> bool { | |
| 1027 | 1027 | self.windows.iter().any(|win| win == window) |
| 1028 | 1028 | } |
| 1029 | 1029 |