diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-06 08:42:09 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-10 07:29:33 -0800 |
| commit | 90f24da6317dea022fff89d538c9ba21a580e97b (patch) | |
| tree | ca678004687d8e323e89abc9aea09025c6631669 /niri-ipc/src | |
| parent | df70140b3631bc1ffdaa2e27be621a35ef491a44 (diff) | |
| download | niri-90f24da6317dea022fff89d538c9ba21a580e97b.tar.gz niri-90f24da6317dea022fff89d538c9ba21a580e97b.tar.bz2 niri-90f24da6317dea022fff89d538c9ba21a580e97b.zip | |
Move ColumnDisplay to niri-ipc
Diffstat (limited to 'niri-ipc/src')
| -rw-r--r-- | niri-ipc/src/lib.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index c2bd2c3c..f6086250 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -690,6 +690,16 @@ pub enum LayoutSwitchTarget { Index(u8), } +/// How windows display in a column. +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] +pub enum ColumnDisplay { + /// Windows are tiled vertically across the working area height. + Normal, + /// Windows are in tabs. + Tabbed, +} + /// Output actions that niri can perform. // Variants in this enum should match the spelling of the ones in niri-config. Most thigs from // niri-config should be present here. @@ -1202,6 +1212,18 @@ impl FromStr for LayoutSwitchTarget { } } +impl FromStr for ColumnDisplay { + type Err = &'static str; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + match s { + "normal" => Ok(Self::Normal), + "tabbed" => Ok(Self::Tabbed), + _ => Err(r#"invalid column display, can be "normal" or "tabbed""#), + } + } +} + impl FromStr for Transform { type Err = &'static str; |
