Skip to content

Commit

Permalink
add left rect to layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Nov 13, 2023
1 parent 6cd58bc commit 7f9f5fa
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ui/burn/fancy/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,34 @@ async fn get_event_child_active(
}

struct ComputedLayout {
disks: Rect,
progress: Rect,
graph: Rect,
args_display: Rect,
}

impl From<Rect> for ComputedLayout {
fn from(value: Rect) -> Self {
fn from(root: Rect) -> Self {
let root = Layout::default()
.direction(Direction::Horizontal)
.constraints([Constraint::Max(16), Constraint::Min(20)])
.split(root);

let rightpane = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(1),
Constraint::Min(10),
Constraint::Length(10),
])
.split(value);
.split(root[1]);

let info_pane = root[2];
let info_pane = rightpane[2];

Self {
graph: root[1],
progress: root[0],
disks: root[0],
graph: rightpane[1],
progress: rightpane[0],
args_display: info_pane,
}
}
Expand Down

0 comments on commit 7f9f5fa

Please sign in to comment.