De-selected cpu lines are hidden from normal chart.

This commit is contained in:
ClementTsang 2020-02-16 18:40:13 -05:00
parent 8a718080a5
commit 8856ea152e

View File

@ -104,6 +104,7 @@ impl Painter {
/// This is to set some remaining styles and text. /// This is to set some remaining styles and text.
/// This bypasses some logic checks (size > 2, for example) but this /// This bypasses some logic checks (size > 2, for example) but this
/// assumes that you, the programmer, are sane and do not do stupid things. /// assumes that you, the programmer, are sane and do not do stupid things.
/// RIGHT?
pub fn initialize(&mut self) { pub fn initialize(&mut self) {
self.styled_general_help_text.push(Text::Styled( self.styled_general_help_text.push(Text::Styled(
GENERAL_HELP_TEXT[0].into(), GENERAL_HELP_TEXT[0].into(),
@ -629,9 +630,9 @@ impl Painter {
if app_state.cpu_state.is_showing_tray { if app_state.cpu_state.is_showing_tray {
entry.push( entry.push(
if app_state.cpu_state.core_show_vec[itx + start_position as usize] { if app_state.cpu_state.core_show_vec[itx + start_position as usize] {
"*".to_string() "[*]".to_string()
} else { } else {
String::default() "[ ]".to_string()
}, },
) )
} }
@ -643,6 +644,13 @@ impl Painter {
let cpu_rows = stringified_cpu_data let cpu_rows = stringified_cpu_data
.iter() .iter()
.enumerate() .enumerate()
.filter(|(itx, _cpu_string_row)| {
if app_state.cpu_state.is_showing_tray {
true
} else {
app_state.cpu_state.core_show_vec[*itx]
}
})
.map(|(itx, cpu_string_row)| { .map(|(itx, cpu_string_row)| {
Row::StyledData( Row::StyledData(
cpu_string_row.iter(), cpu_string_row.iter(),