mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-28 16:14:16 +02:00
bug: fix using 'none' for chart legend position in configs (#1593)
* bug: fix using 'none' for legend position in configs * forgot memory oops * update changelog
This commit is contained in:
parent
eaa56238be
commit
3edf430908
@ -27,6 +27,7 @@ That said, these are more guidelines rather than hardset rules, though the proje
|
|||||||
- [#1551](https://github.com/ClementTsang/bottom/pull/1551): Fix missing parent section names in default config.
|
- [#1551](https://github.com/ClementTsang/bottom/pull/1551): Fix missing parent section names in default config.
|
||||||
- [#1552](https://github.com/ClementTsang/bottom/pull/1552): Fix typo in default config.
|
- [#1552](https://github.com/ClementTsang/bottom/pull/1552): Fix typo in default config.
|
||||||
- [#1578](https://github.com/ClementTsang/bottom/pull/1578): Fix missing selected text background colour in `default-light` theme.
|
- [#1578](https://github.com/ClementTsang/bottom/pull/1578): Fix missing selected text background colour in `default-light` theme.
|
||||||
|
- [#1593](https://github.com/ClementTsang/bottom/pull/1593): Fix using `"none"` for chart legend position in configs.
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ impl FromStr for LegendPosition {
|
|||||||
type Err = ParseLegendPositionError;
|
type Err = ParseLegendPositionError;
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
match s.to_ascii_lowercase().as_str() {
|
match s {
|
||||||
"top" => Ok(Self::Top),
|
"top" => Ok(Self::Top),
|
||||||
"top-left" => Ok(Self::TopLeft),
|
"top-left" => Ok(Self::TopLeft),
|
||||||
"top-right" => Ok(Self::TopRight),
|
"top-right" => Ok(Self::TopRight),
|
||||||
|
@ -960,8 +960,11 @@ fn get_network_legend_position(
|
|||||||
position => Some(parse_config_value!(position.parse(), "network_legend")?),
|
position => Some(parse_config_value!(position.parse(), "network_legend")?),
|
||||||
}
|
}
|
||||||
} else if let Some(flags) = &config.flags {
|
} else if let Some(flags) = &config.flags {
|
||||||
if let Some(legend) = &flags.network_legend {
|
if let Some(s) = &flags.network_legend {
|
||||||
Some(parse_arg_value!(legend.parse(), "network_legend")?)
|
match s.to_ascii_lowercase().trim() {
|
||||||
|
"none" => None,
|
||||||
|
position => Some(parse_arg_value!(position.parse(), "network_legend")?),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Some(LegendPosition::default())
|
Some(LegendPosition::default())
|
||||||
}
|
}
|
||||||
@ -981,8 +984,11 @@ fn get_memory_legend_position(
|
|||||||
position => Some(parse_config_value!(position.parse(), "memory_legend")?),
|
position => Some(parse_config_value!(position.parse(), "memory_legend")?),
|
||||||
}
|
}
|
||||||
} else if let Some(flags) = &config.flags {
|
} else if let Some(flags) = &config.flags {
|
||||||
if let Some(legend) = &flags.memory_legend {
|
if let Some(s) = &flags.memory_legend {
|
||||||
Some(parse_arg_value!(legend.parse(), "memory_legend")?)
|
match s.to_ascii_lowercase().trim() {
|
||||||
|
"none" => None,
|
||||||
|
position => Some(parse_arg_value!(position.parse(), "memory_legend")?),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Some(LegendPosition::default())
|
Some(LegendPosition::default())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user