forge
Explore
Log in

Don't you dare go Hollow

layout: Use column.contains more

Browse files at this commit

4dd7578fe7c55e4b3154b212d757632d173c76c2Ivan MolodetskikhParent: ea72e4d
src/layout/mod.rsmodified+1 -1
@@ -1088,7 +1088,7 @@ impl<W: LayoutElement> Layout<W> {
1088 for mon in &*monitors {1088 for mon in &*monitors {
1089 for ws in &mon.workspaces {1089 for ws in &mon.workspaces {
1090 for col in &ws.columns {1090 for col in &ws.columns {
1091- if col.windows.contains(&window) {1091+ if col.contains(&window) {
1092 width = Some(col.width);1092 width = Some(col.width);
1093 is_full_width = col.is_full_width;1093 is_full_width = col.is_full_width;
1094 break;1094 break;
src/layout/workspace.rsmodified+2 -2
@@ -855,7 +855,7 @@ impl<W: LayoutElement> Workspace<W> {
855 let col = self855 let col = self
856 .columns856 .columns
857 .iter_mut()857 .iter_mut()
858- .find(|col| col.windows.contains(window))858+ .find(|col| col.contains(window))
859 .unwrap();859 .unwrap();
860 let value = !col.is_fullscreen;860 let value = !col.is_fullscreen;
861 self.set_fullscreen(window, value);861 self.set_fullscreen(window, value);
@@ -1023,7 +1023,7 @@ impl<W: LayoutElement> Column<W> {
1023 self.update_window_sizes();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 self.windows.iter().any(|win| win == window)1027 self.windows.iter().any(|win| win == window)
1028 }1028 }
1029 1029