mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add toggle-window-width by-id action
This commit is contained in:
@@ -2116,6 +2116,27 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
cancel_resize_for_column(&mut self.interactive_resize, col);
|
||||
}
|
||||
|
||||
pub fn toggle_window_width(&mut self, window: Option<&W::Id>) {
|
||||
if self.columns.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
let col = if let Some(window) = window {
|
||||
self.columns
|
||||
.iter_mut()
|
||||
.find(|col| col.contains(window))
|
||||
.unwrap()
|
||||
} else {
|
||||
&mut self.columns[self.active_column_idx]
|
||||
};
|
||||
|
||||
// FIXME: when we fix preset fixed width to be per-window, this should also be made
|
||||
// window-specific to resolve the correct window width.
|
||||
col.toggle_width();
|
||||
|
||||
cancel_resize_for_column(&mut self.interactive_resize, col);
|
||||
}
|
||||
|
||||
pub fn toggle_window_height(&mut self, window: Option<&W::Id>) {
|
||||
if self.columns.is_empty() {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user