diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-21 08:37:30 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-21 08:37:30 +0400 |
| commit | 5b1de86d336f7d617f98048fe4318061320d6a29 (patch) | |
| tree | b5d7fe08adc23c0715569a07581f34493d8086f6 /src/config.rs | |
| parent | 58162ce685c487597cc097fe878650a17415a63b (diff) | |
| download | niri-5b1de86d336f7d617f98048fe4318061320d6a29.tar.gz niri-5b1de86d336f7d617f98048fe4318061320d6a29.tar.bz2 niri-5b1de86d336f7d617f98048fe4318061320d6a29.zip | |
Add configurable struts
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index b5428429..b5e98adf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,6 +28,8 @@ pub struct Config { pub default_column_width: Option<DefaultColumnWidth>, #[knuffel(child, unwrap(argument), default = 16)] pub gaps: u16, + #[knuffel(child, default)] + pub struts: Struts, #[knuffel( child, unwrap(argument), @@ -238,6 +240,18 @@ pub enum PresetWidth { #[derive(knuffel::Decode, Debug, Clone, PartialEq)] pub struct DefaultColumnWidth(#[knuffel(children)] pub Vec<PresetWidth>); +#[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq, Eq)] +pub struct Struts { + #[knuffel(child, unwrap(argument), default)] + pub left: u16, + #[knuffel(child, unwrap(argument), default)] + pub right: u16, + #[knuffel(child, unwrap(argument), default)] + pub top: u16, + #[knuffel(child, unwrap(argument), default)] + pub bottom: u16, +} + #[derive(knuffel::Decode, Debug, Default, PartialEq)] pub struct Binds(#[knuffel(children)] pub Vec<Bind>); @@ -594,6 +608,12 @@ mod tests { gaps 8 + struts { + left 1 + right 2 + top 3 + } + screenshot-path "~/Screenshots/screenshot.png" binds { @@ -673,6 +693,12 @@ mod tests { ], default_column_width: Some(DefaultColumnWidth(vec![PresetWidth::Proportion(0.25)])), gaps: 8, + struts: Struts { + left: 1, + right: 2, + top: 3, + bottom: 0, + }, screenshot_path: Some(String::from("~/Screenshots/screenshot.png")), binds: Binds(vec