floating: Implement toggle-width/height actions

This commit is contained in:
Ivan Molodetskikh
2024-12-25 16:43:15 +03:00
parent 3e13fc3e70
commit 1710bb78df
4 changed files with 163 additions and 7 deletions
+10
View File
@@ -2832,6 +2832,16 @@ impl ColumnWidth {
ColumnWidth::Fixed(width) => width,
}
}
pub fn resolve_no_gaps(self, options: &Options, view_width: f64) -> ResolvedSize {
match self {
ColumnWidth::Proportion(proportion) => ResolvedSize::Tile(view_width * proportion),
ColumnWidth::Preset(idx) => {
options.preset_column_widths[idx].resolve_no_gaps(options, view_width)
}
ColumnWidth::Fixed(width) => ResolvedSize::Window(width),
}
}
}
impl From<PresetSize> for ColumnWidth {