Add layer matcher to layer-rule

This commit is contained in:
Ivan Molodetskikh
2026-02-21 13:37:56 +03:00
parent f022b3c504
commit 6bcaaf9d21
7 changed files with 113 additions and 3 deletions
+14
View File
@@ -1868,6 +1868,20 @@ impl FromStr for Transform {
}
}
impl FromStr for Layer {
type Err = &'static str;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"background" => Ok(Self::Background),
"bottom" => Ok(Self::Bottom),
"top" => Ok(Self::Top),
"overlay" => Ok(Self::Overlay),
_ => Err("invalid layer, can be \"background\", \"bottom\", \"top\" or \"overlay\""),
}
}
}
impl FromStr for ModeToSet {
type Err = &'static str;