diff --git a/src/gui/pages/inspect_page.rs b/src/gui/pages/inspect_page.rs index 4367d424..e36060c1 100644 --- a/src/gui/pages/inspect_page.rs +++ b/src/gui/pages/inspect_page.rs @@ -559,10 +559,7 @@ fn get_agglomerates_row<'a>( tot_out_bytes: u128, ) -> Row<'a, Message, StyleType> { let tot_bytes = tot_in_bytes + tot_out_bytes; - let width = ReportCol::ALL - .iter() - .filter(|x| *x != &ReportCol::Bytes && *x != &ReportCol::Packets) - .fold(0.0, |acc, x| acc + x.get_width()); + let width = ReportCol::FILTER_COLUMNS_WIDTH; #[allow(clippy::cast_precision_loss)] let in_length = width * (tot_in_bytes as f32 / tot_bytes as f32); let out_length = width - in_length; diff --git a/src/report/types/report_col.rs b/src/report/types/report_col.rs index bbcf4c6b..dd5e5fb4 100644 --- a/src/report/types/report_col.rs +++ b/src/report/types/report_col.rs @@ -41,6 +41,8 @@ impl ReportCol { ReportCol::Packets, ]; + pub(crate) const FILTER_COLUMNS_WIDTH: f32 = 4.0 * SMALL_COL_WIDTH + 2.0 * LARGE_COL_WIDTH; + pub(crate) fn get_title(&self, language: Language) -> String { match self { ReportCol::SrcIp | ReportCol::DstIp => address_translation(language).to_string(),