layout: Move toggle_fullscreen() impl to Workspace

This commit is contained in:
Ivan Molodetskikh
2024-12-16 09:03:50 +03:00
parent 9f017e834c
commit 965619d096
2 changed files with 6 additions and 14 deletions
-10
View File
@@ -2140,16 +2140,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
}
}
pub fn toggle_fullscreen(&mut self, window: &W::Id) {
let col = self
.columns
.iter_mut()
.find(|col| col.contains(window))
.unwrap();
let value = !col.is_fullscreen;
self.set_fullscreen(window, value);
}
pub fn render_above_top_layer(&self) -> bool {
// Render above the top layer if we're on a fullscreen window and the view is stationary.
if self.columns.is_empty() {
+6 -4
View File
@@ -985,10 +985,12 @@ impl<W: LayoutElement> Workspace<W> {
}
pub fn toggle_fullscreen(&mut self, window: &W::Id) {
if self.floating.has_window(window) {
self.toggle_window_floating(Some(window));
}
self.scrolling.toggle_fullscreen(window);
let tile = self
.tiles()
.find(|tile| tile.window().id() == window)
.unwrap();
let current = tile.window().is_pending_fullscreen();
self.set_fullscreen(window, !current);
}
pub fn toggle_window_floating(&mut self, id: Option<&W::Id>) {