pub fn draw_ui<B>(f: &mut Frame<B>, app: &App, ui_state: &mut UiState)
where
    B: Backend,
{
    let chunks = Layout::default()
        .constraints([Constraint::Length(3), Constraint::Min(0)].as_ref())
        .split(f.size());

    let match_names = app.get_all_matches_short_names();
    let tab_titles = match_names
        .iter()
        .map(|m| Spans::from(Span::styled(m.as_str(), Style::default().fg(Color::White))))
        .collect();

    let tabs = Tabs::new(tab_titles)
        .block(Block::default().borders(Borders::ALL).title("Matches"))
        .highlight_style(Style::default().fg(Color::Green))
        .select(ui_state.focused_tab);
    f.render_widget(tabs, chunks[0]);
    draw_tab(f, chunks[1], app, ui_state);
}
/// Renders the UI onto the terminal
Renders the UI onto the terminal
Renders the UI onto the terminal
pub fn draw_ui<B>(f: &mut Frame<B>, app: &App, ui_state: &mut UiState)
where
    B: Backend,
{
    let chunks = Layout::default()
        .constraints([Constraint::Length(3), Constraint::Min(0)].as_ref())
        .split(f.size());
    let match_names = app.get_all_matches_short_names();
    let tab_titles = match_names
        .iter()
        .map(|m| Spans::from(Span::styled(m.as_str(), Style::default().fg(Color::White))))
        .collect();
    let tabs = Tabs::new(tab_titles)
        .block(Block::default().borders(Borders::ALL).title("Matches"))
        .highlight_style(Style::default().fg(Color::Green))
        .select(ui_state.focused_tab);
    f.render_widget(tabs, chunks[0]);
    draw_tab(f, chunks[1], app, ui_state);
}
pub fn draw_ui < B > ( f : & mut Frame < B > , app : & App , ui_state : & mut UiState ) where B : Backend , { let chunks = Layout :: default ( ) . constraints ( [ Constraint :: Length ( 3 ) , Constraint :: Min ( 0 ) ] . as_ref ( ) ) . split ( f . size ( ) ) ; let match_names = app . get_all_matches_short_names ( ) ; let tab_titles = match_names . iter ( ) . map ( | m | Spans :: from ( Span :: styled ( m . as_str ( ) , Style :: default ( ) . fg ( Color :: White ) ) ) ) . collect ( ) ; let tabs = Tabs :: new ( tab_titles ) . block ( Block :: default ( ) . borders ( Borders :: ALL ) . title ( " " ) ) . highlight_style ( Style :: default ( ) . fg ( Color :: Green ) ) . select ( ui_state . focused_tab ) ; f . render_widget ( tabs , chunks [ 0 ] ) ; draw_tab ( f , chunks [ 1 ] , app , ui_state ) ; }
Renders the UI onto the terminal
Renders the UI onto the terminal
f
&mut Frame<B>
app
&App
ui_state
&mut UiState
f
&mut Frame<B>
app
&App
ui_state
&mut UiState