diff options
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 991e7e42..0e67f3b3 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -971,12 +971,22 @@ impl<W: LayoutElement> Workspace<W> { pub fn center_column(&mut self) { if self.floating_is_active.get() { - self.floating.center_window(); + self.floating.center_window(None); } else { self.scrolling.center_column(); } } + pub fn center_window(&mut self, id: Option<&W::Id>) { + if id.map_or(self.floating_is_active.get(), |id| { + self.floating.has_window(id) + }) { + self.floating.center_window(id); + } else { + self.scrolling.center_window(id); + } + } + pub fn toggle_width(&mut self) { if self.floating_is_active.get() { self.floating.toggle_window_width(None); |
