mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 19:45:23 +00:00
parent
ea6deef11b
commit
2d74a3465a
@ -223,6 +223,8 @@ pub fn draw(ctx: &Ctx, f: &mut Frame<'_>, area: Rect) -> Result<Layout> {
|
||||
// just display the first keybinding
|
||||
.unwrap()
|
||||
.to_string(),
|
||||
// only show the preview keybinding hint if there's actually something to preview
|
||||
ctx.tv_state.preview_state.enabled,
|
||||
)?;
|
||||
|
||||
// input box
|
||||
|
@ -152,15 +152,22 @@ pub fn draw_results_list(
|
||||
colorscheme: &Colorscheme,
|
||||
help_keybinding: &str,
|
||||
preview_keybinding: &str,
|
||||
preview_togglable: bool,
|
||||
) -> Result<()> {
|
||||
let mut toggle_hints = format!(
|
||||
" help: <{help_keybinding}> ",
|
||||
help_keybinding = help_keybinding,
|
||||
);
|
||||
if preview_togglable {
|
||||
toggle_hints.push_str(&format!(
|
||||
" preview: <{preview_keybinding}> ",
|
||||
preview_keybinding = preview_keybinding,
|
||||
));
|
||||
}
|
||||
|
||||
let results_block = Block::default()
|
||||
.title_top(Line::from(" Results ").alignment(Alignment::Center))
|
||||
.title_bottom(
|
||||
Line::from(format!(
|
||||
" help: <{help_keybinding}> preview: <{preview_keybinding}> "
|
||||
))
|
||||
.alignment(Alignment::Center),
|
||||
)
|
||||
.title_bottom(Line::from(toggle_hints).alignment(Alignment::Center))
|
||||
.borders(Borders::ALL)
|
||||
.border_type(BorderType::Rounded)
|
||||
.border_style(Style::default().fg(colorscheme.general.border_fg))
|
||||
|
Loading…
x
Reference in New Issue
Block a user