Partial implementation for additional add-movie details. Need to implement selection menus now but that's it!

This commit is contained in:
2023-08-08 10:50:04 -06:00
parent d1da5af6d7
commit b748d27a06
10 changed files with 602 additions and 103 deletions
+27
View File
@@ -299,3 +299,30 @@ pub fn draw_button<B: Backend>(f: &mut Frame<'_, B>, area: Rect, label: &str, is
f.render_widget(label_paragraph, area);
}
pub fn draw_drop_down_menu<B: Backend>(
f: &mut Frame<'_, B>,
area: Rect,
description: &str,
selection: &str,
is_selected: bool,
) {
let horizontal_chunks = horizontal_chunks(
vec![Constraint::Percentage(50), Constraint::Percentage(50)],
area,
);
let description_paragraph = Paragraph::new(Text::from(format!("\n{}: ", description)))
.block(borderless_block())
.alignment(Alignment::Right)
.style(style_primary());
f.render_widget(description_paragraph, horizontal_chunks[0]);
draw_button(
f,
horizontal_chunks[1],
format!("{}", selection).as_str(),
is_selected,
);
}