From e6230ef156efe907f2cf76af4298a7e34df330b4 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Thu, 18 Feb 2021 19:15:07 -0500 Subject: [PATCH] bug: fix inconsistent spacing with grouped vs non-grouped in the process widget (#416) Fixes grouped mode having different spacing than non-grouped mode. --- CHANGELOG.md | 4 ++++ src/canvas/widgets/process_table.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb4bf6c6..b6a12b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#391](https://github.com/ClementTsang/bottom/pull/391): Show degree symbol on Celsius and Fahrenheit. +## Bug Fixes + +- [#416](https://github.com/ClementTsang/bottom/pull/416): Fixes grouped vs ungrouped modes in the processes widget having inconsistent spacing. + ## [0.5.7] - 2021-01-30 ## Bug Fixes diff --git a/src/canvas/widgets/process_table.rs b/src/canvas/widgets/process_table.rs index fa5f3393..f655b2c1 100644 --- a/src/canvas/widgets/process_table.rs +++ b/src/canvas/widgets/process_table.rs @@ -52,7 +52,7 @@ static PROCESS_HEADERS_SOFT_WIDTH_MAX_GROUPED_COMMAND: Lazy>> = static PROCESS_HEADERS_SOFT_WIDTH_MAX_GROUPED_TREE: Lazy>> = Lazy::new(|| vec![None, Some(0.5), None, None, None, None, None, None]); static PROCESS_HEADERS_SOFT_WIDTH_MAX_GROUPED_ELSE: Lazy>> = - Lazy::new(|| vec![None, Some(0.4), None, None, None, None, None, None]); + Lazy::new(|| vec![None, Some(0.3), None, None, None, None, None, None]); static PROCESS_HEADERS_SOFT_WIDTH_MAX_NO_GROUP_COMMAND: Lazy>> = Lazy::new(|| { vec![ @@ -356,6 +356,7 @@ impl ProcessTableWidget for Painter { .iter() .map(|entry| UnicodeWidthStr::width(entry.as_str()) as u16) .collect::>(); + let soft_widths_min = column_widths .iter() .map(|width| Some(*width))