diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-06 13:04:21 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-06 13:04:21 +0400 |
| commit | 4e0aa391137a53180783ab3d2d0ff0cc6311b23b (patch) | |
| tree | c247452d66a09602fc2338980e8bc4582d5b7a07 /src/layout/mod.rs | |
| parent | dcb80efc8803e9a7a90f26044867bf4fd7671310 (diff) | |
| download | niri-4e0aa391137a53180783ab3d2d0ff0cc6311b23b.tar.gz niri-4e0aa391137a53180783ab3d2d0ff0cc6311b23b.tar.bz2 niri-4e0aa391137a53180783ab3d2d0ff0cc6311b23b.zip | |
[cfg-breaking] Move layout settings into their own scope
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9c3fb66b..c7fce722 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -164,7 +164,8 @@ impl Default for Options { impl Options { fn from_config(config: &Config) -> Self { - let preset_column_widths = &config.preset_column_widths; + let layout = &config.layout; + let preset_column_widths = &layout.preset_column_widths; let preset_widths = if preset_column_widths.is_empty() { Options::default().preset_widths @@ -178,17 +179,17 @@ impl Options { // Missing default_column_width maps to Some(ColumnWidth::Proportion(0.5)), // while present, but empty, maps to None. - let default_width = config + let default_width = layout .default_column_width .as_ref() .map(|w| w.0.first().copied().map(ColumnWidth::from)) .unwrap_or(Some(ColumnWidth::Proportion(0.5))); Self { - gaps: config.gaps.into(), - struts: config.struts, - focus_ring: config.focus_ring, - border: config.border, + gaps: layout.gaps.into(), + struts: layout.struts, + focus_ring: layout.focus_ring, + border: layout.border, preset_widths, default_width, } |
