Create Layout for List mode

This commit is contained in:
Jaby 2023-08-20 08:36:08 +02:00 committed by Jaby
parent 248e2adc7d
commit 72892ac38d
1 changed files with 23 additions and 9 deletions

View File

@ -332,16 +332,30 @@ impl ConsoleUI {
}
fn render_list(frame: &mut ConsoleFrame, layout: Rect) {
let text = Paragraph::new("Comming soon")
let (info_layout, list_layout) = {
let layout = Layout::default().direction(Direction::Vertical).constraints([
Constraint::Min(5),
Constraint::Max(5),
]).split(layout);
(layout[1], Layout::default().direction(Direction::Horizontal).constraints([
Constraint::Percentage(50),
Constraint::Percentage(50)
]).split(layout[0]))
};
let text = Paragraph::new("Schwimmflügel")
.style(Style::default().fg(Color::White))
.alignment(Alignment::Center)
.block(Block::default()
.borders(Borders::ALL)
.style(Style::default().fg(Color::White))
.border_type(BorderType::Plain).title("QUIT")
.border_type(BorderType::Plain).title("Wuffi")
);
frame.render_widget(text, layout);
frame.render_widget(text.clone(), info_layout);
frame.render_widget(text.clone(), list_layout[0]);
frame.render_widget(text, list_layout[1]);
}
fn render_quit(frame: &mut ConsoleFrame, layout: Rect) {