From 1c14a0a2a97867878c65ea33fa8b927618efb555 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 11 May 2024 09:33:23 +0400 Subject: Add a reset-window-height action --- src/layout/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/layout/mod.rs') 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 Layout { 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 { -- cgit