fix(layout): allow lowercase keys and values (#1160)
A layout needed to be specified as follows:
```
---
template:
direction: Horizontal
parts:
- direction: Vertical
body: true
- direction: Vertical
borderless: true
split_size:
Fixed: 1
```
now the same layout can be specified as:
```
---
template:
direction: horizontal
parts:
- direction: vertical
body: true
- direction: vertical
borderless: true
split_size:
fixed: 1
```
This commit is contained in:
parent
d1c3a367d1
commit
cd4b8ae8b6
1 changed files with 4 additions and 0 deletions
|
|
@ -37,7 +37,9 @@ use url::Url;
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
|
||||||
#[serde(crate = "self::serde")]
|
#[serde(crate = "self::serde")]
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
|
#[serde(alias = "horizontal")]
|
||||||
Horizontal,
|
Horizontal,
|
||||||
|
#[serde(alias = "vertical")]
|
||||||
Vertical,
|
Vertical,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +57,9 @@ impl Not for Direction {
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
|
||||||
#[serde(crate = "self::serde")]
|
#[serde(crate = "self::serde")]
|
||||||
pub enum SplitSize {
|
pub enum SplitSize {
|
||||||
|
#[serde(alias = "percent")]
|
||||||
Percent(f64), // 1 to 100
|
Percent(f64), // 1 to 100
|
||||||
|
#[serde(alias = "fixed")]
|
||||||
Fixed(usize), // An absolute number of columns or rows
|
Fixed(usize), // An absolute number of columns or rows
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue