summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/display/components/total_bandwidth.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/display/components/total_bandwidth.rs b/src/display/components/total_bandwidth.rs
index c9a9676..8a16b3e 100644
--- a/src/display/components/total_bandwidth.rs
+++ b/src/display/components/total_bandwidth.rs
@@ -87,7 +87,10 @@ impl<'a> HeaderDetails<'a> {
fn header_parts(&self, rect: Rect) -> Vec<Rect> {
const MAX_BANDWIDTH_STRING_LENGTH: u16 = 31;
- let number_of_columns = rect.width / MAX_BANDWIDTH_STRING_LENGTH;
+ let number_of_columns = *[3, rect.width / MAX_BANDWIDTH_STRING_LENGTH]
+ .iter()
+ .min()
+ .unwrap();
let constraints: Vec<Constraint> = (0..number_of_columns)
.map(|_| Constraint::Percentage(100 / number_of_columns))
.collect();