diff options
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/floating.rs | 7 | ||||
| -rw-r--r-- | src/layout/mod.rs | 5 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/layout/floating.rs b/src/layout/floating.rs index c6a17e30..3ac995f0 100644 --- a/src/layout/floating.rs +++ b/src/layout/floating.rs @@ -677,12 +677,7 @@ impl<W: LayoutElement> FloatingSpace<W> { }; let preset = self.options.preset_window_heights[preset_idx]; - let change = match preset { - PresetSize::Proportion(prop) => SizeChange::SetProportion(prop * 100.), - PresetSize::Fixed(fixed) => SizeChange::SetFixed(fixed), - }; - - self.set_window_height(Some(&id), change, true); + self.set_window_height(Some(&id), SizeChange::from(preset), true); let tile = &mut self.tiles[idx]; tile.floating_preset_height_idx = Some(preset_idx); diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 2631dd72..ff355615 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -862,10 +862,7 @@ impl<W: LayoutElement> Layout<W> { activate: ActivateWindow, ) -> Option<&Output> { let resolved_width = self.resolve_default_width(&window, width, is_floating); - let resolved_height = height.map(|h| match h { - PresetSize::Proportion(prop) => SizeChange::SetProportion(prop * 100.), - PresetSize::Fixed(fixed) => SizeChange::SetFixed(fixed), - }); + let resolved_height = height.map(SizeChange::from); let id = window.id().clone(); match &mut self.monitor_set { |
