layout: Use column.contains more

This commit is contained in:
Ivan Molodetskikh
2023-12-25 11:06:03 +04:00
parent ea72e4dae8
commit 4dd7578fe7
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1088,7 +1088,7 @@ impl<W: LayoutElement> Layout<W> {
for mon in &*monitors {
for ws in &mon.workspaces {
for col in &ws.columns {
if col.windows.contains(&window) {
if col.contains(&window) {
width = Some(col.width);
is_full_width = col.is_full_width;
break;
+2 -2
View File
@@ -855,7 +855,7 @@ impl<W: LayoutElement> Workspace<W> {
let col = self
.columns
.iter_mut()
.find(|col| col.windows.contains(window))
.find(|col| col.contains(window))
.unwrap();
let value = !col.is_fullscreen;
self.set_fullscreen(window, value);
@@ -1023,7 +1023,7 @@ impl<W: LayoutElement> Column<W> {
self.update_window_sizes();
}
fn contains(&self, window: &W) -> bool {
pub fn contains(&self, window: &W) -> bool {
self.windows.iter().any(|win| win == window)
}