aboutsummaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorelkowar <dev@elkowar.dev>2024-08-29 16:41:59 +0200
committerIvan Molodetskikh <yalterz@gmail.com>2024-09-05 01:01:41 -0700
commitfd8ebb9d06ee6012b948042da794a0104096549e (patch)
treef007a772732e0e6f69d95ac7101d21e97576c78e /src/layout/mod.rs
parent952916fd1c61ebd61e7b40211d97fdd0c15e85d1 (diff)
downloadniri-fd8ebb9d06ee6012b948042da794a0104096549e.tar.gz
niri-fd8ebb9d06ee6012b948042da794a0104096549e.tar.bz2
niri-fd8ebb9d06ee6012b948042da794a0104096549e.zip
implement always_center_single_column layout option
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 734512dd..fd1c5f7e 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -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()