implement always_center_single_column layout option

This commit is contained in:
elkowar
2024-08-29 16:41:59 +02:00
committed by Ivan Molodetskikh
parent 952916fd1c
commit fd8ebb9d06
3 changed files with 27 additions and 4 deletions
+5
View File
@@ -236,6 +236,7 @@ pub struct Options {
pub focus_ring: niri_config::FocusRing,
pub border: niri_config::Border,
pub center_focused_column: CenterFocusedColumn,
pub always_center_single_column: bool,
/// Column widths that `toggle_width()` switches between.
pub preset_widths: Vec<ColumnWidth>,
/// Initial width for new columns.
@@ -255,6 +256,7 @@ impl Default for Options {
focus_ring: Default::default(),
border: Default::default(),
center_focused_column: Default::default(),
always_center_single_column: false,
preset_widths: vec![
ColumnWidth::Proportion(1. / 3.),
ColumnWidth::Proportion(0.5),
@@ -297,6 +299,7 @@ impl Options {
focus_ring: layout.focus_ring,
border: layout.border,
center_focused_column: layout.center_focused_column,
always_center_single_column: layout.always_center_single_column,
preset_widths,
default_width,
animations: config.animations.clone(),
@@ -4455,11 +4458,13 @@ mod tests {
focus_ring in arbitrary_focus_ring(),
border in arbitrary_border(),
center_focused_column in arbitrary_center_focused_column(),
always_center_single_column in any::<bool>(),
) -> Options {
Options {
gaps,
struts,
center_focused_column,
always_center_single_column,
focus_ring,
border,
..Default::default()