Redid how we auto-set time if we have autohide on.
This commit is contained in:
parent
8630287676
commit
46f1b7df00
|
@ -246,7 +246,7 @@ impl Default for NetState {
|
|||
zoom_level: 100.0,
|
||||
display_time: constants::DEFAULT_TIME_MILLISECONDS,
|
||||
force_update: false,
|
||||
display_time_instant: Some(Instant::now()),
|
||||
display_time_instant: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ impl Default for CpuState {
|
|||
core_show_vec: Vec::new(),
|
||||
display_time: constants::DEFAULT_TIME_MILLISECONDS,
|
||||
force_update: false,
|
||||
display_time_instant: Some(Instant::now()),
|
||||
display_time_instant: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ impl Default for MemState {
|
|||
zoom_level: 100.0,
|
||||
display_time: constants::DEFAULT_TIME_MILLISECONDS,
|
||||
force_update: false,
|
||||
display_time_instant: Some(Instant::now()),
|
||||
display_time_instant: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,10 +305,18 @@ pub fn enable_hide_time(matches: &clap::ArgMatches<'static>, config: &Config, ap
|
|||
pub fn enable_autohide_time(matches: &clap::ArgMatches<'static>, config: &Config, app: &mut App) {
|
||||
if matches.is_present("AUTOHIDE_TIME") {
|
||||
app.app_config_fields.autohide_time = true;
|
||||
let time = Some(std::time::Instant::now());
|
||||
app.cpu_state.display_time_instant = time;
|
||||
app.mem_state.display_time_instant = time;
|
||||
app.net_state.display_time_instant = time;
|
||||
} else if let Some(flags) = &config.flags {
|
||||
if let Some(autohide_time) = flags.autohide_time {
|
||||
if autohide_time {
|
||||
app.app_config_fields.autohide_time = true;
|
||||
let time = Some(std::time::Instant::now());
|
||||
app.cpu_state.display_time_instant = time;
|
||||
app.mem_state.display_time_instant = time;
|
||||
app.net_state.display_time_instant = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue