diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-11 09:33:23 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-11 09:33:23 +0400 |
| commit | 1c14a0a2a97867878c65ea33fa8b927618efb555 (patch) | |
| tree | 16bb26bf1d8b83fca5d768bce7577443e26584e5 /src/layout/mod.rs | |
| parent | 2fd9a03bd71b4709659cdd35192109b47c3b0e10 (diff) | |
| download | niri-1c14a0a2a97867878c65ea33fa8b927618efb555.tar.gz niri-1c14a0a2a97867878c65ea33fa8b927618efb555.tar.bz2 niri-1c14a0a2a97867878c65ea33fa8b927618efb555.zip | |
Add a reset-window-height action
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 22aaa7fa..75f6cd4c 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1477,6 +1477,13 @@ impl<W: LayoutElement> Layout<W> { monitor.set_window_height(change); } + pub fn reset_window_height(&mut self) { + let Some(monitor) = self.active_monitor() else { + return; + }; + monitor.reset_window_height(); + } + pub fn focus_output(&mut self, output: &Output) { if let MonitorSet::Normal { monitors, @@ -2335,6 +2342,7 @@ mod tests { MaximizeColumn, SetColumnWidth(#[proptest(strategy = "arbitrary_size_change()")] SizeChange), SetWindowHeight(#[proptest(strategy = "arbitrary_size_change()")] SizeChange), + ResetWindowHeight, Communicate(#[proptest(strategy = "1..=5usize")] usize), MoveWorkspaceToOutput(#[proptest(strategy = "1..=5u8")] u8), ViewOffsetGestureBegin { @@ -2563,6 +2571,7 @@ mod tests { Op::MaximizeColumn => layout.toggle_full_width(), Op::SetColumnWidth(change) => layout.set_column_width(change), Op::SetWindowHeight(change) => layout.set_window_height(change), + Op::ResetWindowHeight => layout.reset_window_height(), Op::Communicate(id) => { let mut update = false; match &mut layout.monitor_set { |
