mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +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 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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user