Skip to content

Commit

Permalink
Split layout
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Nov 29, 2024
1 parent 7473f7a commit 8072733
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ where
}

fn draw(frame: &mut Frame) {
let outer_layout = Layout::default()
.direction(Direction::Horizontal)
.constraints(vec![Constraint::Percentage(40), Constraint::Percentage(60)])
.split(frame.area());
let layout = Layout::default()
.direction(Direction::Vertical)
.constraints(vec![Constraint::Percentage(50), Constraint::Percentage(50)])
.split(frame.area());
.split(outer_layout[0]);

let greeting = Paragraph::new("Hello Ratatui! (press 'q' to quit)")
.white()
Expand Down

0 comments on commit 8072733

Please sign in to comment.