Fix bug with autohide causing hide to break.

This commit is contained in:
ClementTsang 2020-03-10 01:26:30 -04:00
parent e5588f1606
commit 1046043138
4 changed files with 10 additions and 4 deletions

View File

@ -30,7 +30,9 @@ Features of bottom include:
- Maximizing of widgets of interest to take up the entire window.
- Basic mode
- A minimal mode that focuses less on graphs and more on data, similar to [htop](https://hisham.hm/htop/).
- Zooming in/out to see more/less data.
More details about each widget and compatibility can be found [here](./docs/widgets.md).

View File

@ -47,8 +47,10 @@ impl CpuGraphWidget for Painter {
format!("{}s", app_state.cpu_state.display_time / 1000),
"0s".to_string(),
];
let x_axis = if app_state.app_config_fields.hide_time
|| app_state.cpu_state.display_time_instant.is_none()
|| (app_state.app_config_fields.autohide_time
&& app_state.cpu_state.display_time_instant.is_none())
{
Axis::default().bounds([0.0, app_state.cpu_state.display_time as f64])
} else if let Some(time) = app_state.cpu_state.display_time_instant {

View File

@ -31,7 +31,8 @@ impl MemGraphWidget for Painter {
"0s".to_string(),
];
let x_axis = if app_state.app_config_fields.hide_time
|| app_state.mem_state.display_time_instant.is_none()
|| (app_state.app_config_fields.autohide_time
&& app_state.mem_state.display_time_instant.is_none())
{
Axis::default().bounds([0.0, app_state.mem_state.display_time as f64])
} else if let Some(time) = app_state.mem_state.display_time_instant {

View File

@ -44,7 +44,8 @@ impl NetworkGraphWidget for Painter {
"0s".to_string(),
];
let x_axis = if app_state.app_config_fields.hide_time
|| app_state.net_state.display_time_instant.is_none()
|| (app_state.app_config_fields.autohide_time
&& app_state.net_state.display_time_instant.is_none())
{
Axis::default().bounds([0.0, app_state.net_state.display_time as f64])
} else if let Some(time) = app_state.net_state.display_time_instant {