From ddb5c3f9b8c7ea6835407cb3493683526e01cb1f Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Mon, 4 Mar 2024 13:00:33 +0100 Subject: [PATCH] lib: Remove cutoff from footer --- src/flux/ui/widget/container.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/flux/ui/widget/container.rs b/src/flux/ui/widget/container.rs index bc643960..f4635d4f 100644 --- a/src/flux/ui/widget/container.rs +++ b/src/flux/ui/widget/container.rs @@ -77,16 +77,8 @@ impl Footer { impl<'a, A, const W: usize> Render> for Footer { fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: FooterProps) { - let widths = props.widths.to_vec(); - let widths = if area.width < props.cutoff as u16 { - widths - .into_iter() - .take(props.cutoff_after) - .collect::>() - } else { - widths.into_iter().collect::>() - }; - let widths = widths + let widths = props + .widths .into_iter() .map(|c| match c { Constraint::Min(min) => Constraint::Length(min.saturating_add(3)), @@ -101,7 +93,6 @@ impl<'a, A, const W: usize> Render> for Footer { let len = cells.len(); for (i, (cell, area)) in cells.into_iter().enumerate() { - // let last = cells.len().saturating_sub(1); let block_type = match i { 0 if len == 1 => FooterBlockType::Single, 0 => FooterBlockType::Begin,