diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-25 16:43:15 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 1710bb78df51ae763e926297c02acf9f9036cf74 (patch) | |
| tree | ea5aabf8fef702a4446b290ff50f5b5ac35437e6 /src/layout/scrolling.rs | |
| parent | 3e13fc3e705f5a9c14cc993d4841ee1346e883f2 (diff) | |
| download | niri-1710bb78df51ae763e926297c02acf9f9036cf74.tar.gz niri-1710bb78df51ae763e926297c02acf9f9036cf74.tar.bz2 niri-1710bb78df51ae763e926297c02acf9f9036cf74.zip | |
floating: Implement toggle-width/height actions
Diffstat (limited to 'src/layout/scrolling.rs')
| -rw-r--r-- | src/layout/scrolling.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 1fe8cc34..7cb01218 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -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 { |
