diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-03-10 01:43:42 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-03-10 01:43:42 -0400 |
commit | 46f1b7df0031efbf7ddd05aef4c486bfd1ddaa71 (patch) | |
tree | 21d74fdee7d4735f04b43f08e57e7f128f1e8f6b /src/options.rs | |
parent | 8630287676baad0f5b50ecf41dcde652128f6d00 (diff) |
Redid how we auto-set time if we have autohide on.
Diffstat (limited to 'src/options.rs')
-rw-r--r-- | src/options.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/options.rs b/src/options.rs index a5cd832e..654a9356 100644 --- a/src/options.rs +++ b/src/options.rs @@ -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; } } } |