aboutsummaryrefslogtreecommitdiff
path: root/src/layout/floating.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-01-31 19:24:26 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-01-31 21:15:43 +0300
commit88c6778771d8196621072b562466f6e8e68dbbc3 (patch)
tree04e4268b1b602f96e2e12316f8dd25ed344202a2 /src/layout/floating.rs
parent73f6d3366ee801e27f7c50601117e5e747d88899 (diff)
downloadniri-88c6778771d8196621072b562466f6e8e68dbbc3.tar.gz
niri-88c6778771d8196621072b562466f6e8e68dbbc3.tar.bz2
niri-88c6778771d8196621072b562466f6e8e68dbbc3.zip
Extract SizeChange::from(PresetSize)
Diffstat (limited to 'src/layout/floating.rs')
-rw-r--r--src/layout/floating.rs7
1 files changed, 1 insertions, 6 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);