Create Layout for List mode

This commit is contained in:
jaby 2023-08-20 08:36:08 +02:00
parent 310519203a
commit 2261735ef3
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) { fn render_list(frame: &mut ConsoleFrame, layout: Rect) {
let text = Paragraph::new("Comming soon") let (info_layout, list_layout) = {
.style(Style::default().fg(Color::White)) let layout = Layout::default().direction(Direction::Vertical).constraints([
.alignment(Alignment::Center) Constraint::Min(5),
.block(Block::default() Constraint::Max(5),
.borders(Borders::ALL) ]).split(layout);
.style(Style::default().fg(Color::White))
.border_type(BorderType::Plain).title("QUIT")
);
frame.render_widget(text, 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("Wuffi")
);
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) { fn render_quit(frame: &mut ConsoleFrame, layout: Rect) {