Move ColumnDisplay to niri-ipc

This commit is contained in:
Ivan Molodetskikh
2025-02-06 08:42:09 +03:00
parent df70140b36
commit 90f24da631
4 changed files with 30 additions and 18 deletions
+22
View File
@@ -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;