diff --git a/bin/commands/inbox/select/ui.rs b/bin/commands/inbox/select/ui.rs index 15d6f525..f0d9cd71 100644 --- a/bin/commands/inbox/select/ui.rs +++ b/bin/commands/inbox/select/ui.rs @@ -412,12 +412,14 @@ impl Notifications { frame, area, FooterProps { - cells: [search.into(), block.clone().into(), progress.clone().into()], + cells: [search.into(), block.clone().into(), progress.clone().into()] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(block.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -434,13 +436,15 @@ impl Notifications { seen.clone().into(), unseen.clone().into(), progress.clone().into(), - ], + ] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(seen.width() as u16), Constraint::Min(unseen.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -800,8 +804,8 @@ impl<'a> Render<()> for Help<'a> { frame, footer_area, FooterProps { - cells: [String::new().into(), progress.clone().into()], - widths: [Constraint::Fill(1), Constraint::Min(4)], + cells: [String::new().into(), progress.clone().into()].to_vec(), + widths: [Constraint::Fill(1), Constraint::Min(4)].to_vec(), focus: self.props.focus, cutoff: usize::MAX, cutoff_after: usize::MAX, diff --git a/bin/commands/issue/select/ui.rs b/bin/commands/issue/select/ui.rs index 8a078021..22046d33 100644 --- a/bin/commands/issue/select/ui.rs +++ b/bin/commands/issue/select/ui.rs @@ -432,12 +432,14 @@ impl Issues { frame, area, FooterProps { - cells: [search.into(), block.clone().into(), progress.clone().into()], + cells: [search.into(), block.clone().into(), progress.clone().into()] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(block.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -455,14 +457,16 @@ impl Issues { closed.clone().into(), sum.clone().into(), progress.clone().into(), - ], + ] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(open.width() as u16), Constraint::Min(closed.width() as u16), Constraint::Min(sum.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -822,8 +826,8 @@ impl<'a> Render<()> for Help<'a> { frame, footer_area, FooterProps { - cells: [String::new().into(), progress.clone().into()], - widths: [Constraint::Fill(1), Constraint::Min(4)], + cells: [String::new().into(), progress.clone().into()].to_vec(), + widths: [Constraint::Fill(1), Constraint::Min(4)].to_vec(), focus: self.props.focus, cutoff: usize::MAX, cutoff_after: usize::MAX, diff --git a/bin/commands/patch/select/ui.rs b/bin/commands/patch/select/ui.rs index 77424a9b..fa3cc811 100644 --- a/bin/commands/patch/select/ui.rs +++ b/bin/commands/patch/select/ui.rs @@ -457,12 +457,14 @@ impl Patches { frame, area, FooterProps { - cells: [search.into(), block.clone().into(), progress.clone().into()], + cells: [search.into(), block.clone().into(), progress.clone().into()] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(block.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -482,7 +484,8 @@ impl Patches { archived.clone().into(), sum.clone().into(), progress.clone().into(), - ], + ] + .to_vec(), widths: [ Constraint::Fill(1), Constraint::Min(draft.width() as u16), @@ -491,7 +494,8 @@ impl Patches { Constraint::Min(archived.width() as u16), Constraint::Min(sum.width() as u16), Constraint::Min(4), - ], + ] + .to_vec(), focus: self.props.focus, cutoff: self.props.cutoff, cutoff_after: self.props.cutoff_after, @@ -859,8 +863,8 @@ impl<'a> Render<()> for Help<'a> { frame, footer_area, FooterProps { - cells: [String::new().into(), progress.clone().into()], - widths: [Constraint::Fill(1), Constraint::Min(4)], + cells: [String::new().into(), progress.clone().into()].to_vec(), + widths: [Constraint::Fill(1), Constraint::Min(4)].to_vec(), focus: self.props.focus, cutoff: usize::MAX, cutoff_after: usize::MAX, diff --git a/src/ui/widget/container.rs b/src/ui/widget/container.rs index aa420e4d..ff6f10ed 100644 --- a/src/ui/widget/container.rs +++ b/src/ui/widget/container.rs @@ -13,9 +13,9 @@ use crate::ui::theme::style; use super::{Column, Render, Widget}; #[derive(Debug)] -pub struct FooterProps<'a, const W: usize> { - pub cells: [Text<'a>; W], - pub widths: [Constraint; W], +pub struct FooterProps<'a> { + pub cells: Vec>, + pub widths: Vec, pub cutoff: usize, pub cutoff_after: usize, pub focus: bool, @@ -71,8 +71,8 @@ impl Footer { } } -impl<'a, A, const W: usize> Render> for Footer { - fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: FooterProps) { +impl<'a, A> Render> for Footer { + fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: FooterProps) { let widths = props .widths .into_iter()