bug: Fix missing states in processes (#345)

Fixes another change breaking states from showing in processes.
This commit is contained in:
Clement Tsang
2020-12-10 00:03:55 -05:00
committed by GitHub
parent 19cdc269fb
commit ce020a7429
6 changed files with 64 additions and 44 deletions
+13
View File
@@ -22,6 +22,19 @@ pub fn get_column_widths(
total_width: u16, hard_widths: &[Option<u16>], soft_widths_min: &[Option<u16>],
soft_widths_max: &[Option<f64>], soft_widths_desired: &[Option<u16>], left_to_right: bool,
) -> Vec<u16> {
debug_assert!(
hard_widths.len() == soft_widths_min.len(),
"hard width length != soft width min length!"
);
debug_assert!(
soft_widths_min.len() == soft_widths_max.len(),
"soft width min length != soft width max length!"
);
debug_assert!(
soft_widths_max.len() == soft_widths_desired.len(),
"soft width max length != soft width desired length!"
);
let initial_width = total_width - 2;
let mut total_width_left = initial_width;
let mut column_widths: Vec<u16> = vec![0; hard_widths.len()];
+1 -1
View File
@@ -31,6 +31,7 @@ static PROCESS_HEADERS_HARD_WIDTH_NO_GROUP: Lazy<Vec<Option<u16>>> = Lazy::new(|
Some(8),
Some(7),
Some(8),
None,
]
});
static PROCESS_HEADERS_HARD_WIDTH_GROUPED: Lazy<Vec<Option<u16>>> = Lazy::new(|| {
@@ -43,7 +44,6 @@ static PROCESS_HEADERS_HARD_WIDTH_GROUPED: Lazy<Vec<Option<u16>>> = Lazy::new(||
Some(8),
Some(7),
Some(8),
None,
]
});
+8 -8
View File
@@ -135,13 +135,13 @@ Hides the spacing between table headers and entries.\n\n",
"\
Completely hides the time scaling from being shown.\n\n",
);
let show_table_scroll_position = Arg::with_name("show_table_scroll_position")
.long("show_table_scroll_position")
.help("Shows the scroll position tracker in table widgets")
.long_help(
"\
Shows the list scroll position tracker in the widget title for table widgets.\n\n",
);
// let show_table_scroll_position = Arg::with_name("show_table_scroll_position")
// .long("show_table_scroll_position")
// .help("Shows the scroll position tracker in table widgets")
// .long_help(
// "\
// Shows the list scroll position tracker in the widget title for table widgets.\n\n",
// );
let left_legend = Arg::with_name("left_legend")
.short("l")
.long("left_legend")
@@ -373,7 +373,7 @@ Defaults to showing the process widget in tree mode.\n\n",
.arg(hide_avg_cpu)
.arg(hide_table_gap)
.arg(hide_time)
.arg(show_table_scroll_position)
// .arg(show_table_scroll_position)
.arg(left_legend)
// .arg(no_write)
.arg(rate)
+9 -8
View File
@@ -977,13 +977,14 @@ fn get_is_default_tree(matches: &clap::ArgMatches<'static>, config: &Config) ->
false
}
fn get_show_table_scroll_position(matches: &clap::ArgMatches<'static>, config: &Config) -> bool {
if matches.is_present("show_table_scroll_position") {
return true;
} else if let Some(flags) = &config.flags {
if let Some(show_table_scroll_position) = flags.show_table_scroll_position {
return show_table_scroll_position;
}
}
// FIXME: Re-enable this for 0.6
fn get_show_table_scroll_position(_matches: &clap::ArgMatches<'static>, _config: &Config) -> bool {
// if matches.is_present("show_table_scroll_position") {
// return true;
// } else if let Some(flags) = &config.flags {
// if let Some(show_table_scroll_position) = flags.show_table_scroll_position {
// return show_table_scroll_position;
// }
// }
false
}