mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
layout: Use column.contains more
This commit is contained in:
+1
-1
@@ -1088,7 +1088,7 @@ impl<W: LayoutElement> Layout<W> {
|
|||||||
for mon in &*monitors {
|
for mon in &*monitors {
|
||||||
for ws in &mon.workspaces {
|
for ws in &mon.workspaces {
|
||||||
for col in &ws.columns {
|
for col in &ws.columns {
|
||||||
if col.windows.contains(&window) {
|
if col.contains(&window) {
|
||||||
width = Some(col.width);
|
width = Some(col.width);
|
||||||
is_full_width = col.is_full_width;
|
is_full_width = col.is_full_width;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ impl<W: LayoutElement> Workspace<W> {
|
|||||||
let col = self
|
let col = self
|
||||||
.columns
|
.columns
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|col| col.windows.contains(window))
|
.find(|col| col.contains(window))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let value = !col.is_fullscreen;
|
let value = !col.is_fullscreen;
|
||||||
self.set_fullscreen(window, value);
|
self.set_fullscreen(window, value);
|
||||||
@@ -1023,7 +1023,7 @@ impl<W: LayoutElement> Column<W> {
|
|||||||
self.update_window_sizes();
|
self.update_window_sizes();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains(&self, window: &W) -> bool {
|
pub fn contains(&self, window: &W) -> bool {
|
||||||
self.windows.iter().any(|win| win == window)
|
self.windows.iter().any(|win| win == window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user