diff options
author | ClementTsang <clementjhtsang@gmail.com> | 2019-11-05 16:33:57 -0500 |
---|---|---|
committer | ClementTsang <clementjhtsang@gmail.com> | 2019-11-05 16:33:57 -0500 |
commit | ff595cd0285aa2740e1735589d5ed8bc5c4d7d61 (patch) | |
tree | 99fc9b9c37f5e9e6ff063b3ed9749a65d55fabe0 /src/canvas.rs | |
parent | 94bf570b87367da23545ebef494d724f4eeeb8a3 (diff) |
Fanagle with tui. Going to probably put this on halt until tui-rs pushes a new stable release...
Diffstat (limited to 'src/canvas.rs')
-rw-r--r-- | src/canvas.rs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/canvas.rs b/src/canvas.rs index 33c136a0..f8c50577 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -269,7 +269,7 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state : }), ) .header_style(Style::default().fg(Color::LightBlue)) - .widths(&[(width * 0.45) as u16, (width * 0.4) as u16]) + .widths(&[Constraint::Length((width * 0.45) as u16), Constraint::Length((width * 0.4) as u16)]) .render(&mut f, middle_divided_chunk_2[0]); } @@ -316,13 +316,13 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state : ) .header_style(Style::default().fg(Color::LightBlue).modifier(Modifier::BOLD)) .widths(&[ - (width * 0.18).floor() as u16, - (width * 0.14).floor() as u16, - (width * 0.11).floor() as u16, - (width * 0.11).floor() as u16, - (width * 0.11).floor() as u16, - (width * 0.11).floor() as u16, - (width * 0.11).floor() as u16, + Constraint::Length((width * 0.18).floor() as u16), + Constraint::Length((width * 0.14).floor() as u16), + Constraint::Length((width * 0.11).floor() as u16), + Constraint::Length((width * 0.11).floor() as u16), + Constraint::Length((width * 0.11).floor() as u16), + Constraint::Length((width * 0.11).floor() as u16), + Constraint::Length((width * 0.11).floor() as u16), ]) .render(&mut f, middle_divided_chunk_2[1]); } @@ -435,7 +435,12 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state : }), ) .header_style(Style::default().fg(Color::LightBlue)) - .widths(&[(width * 0.2) as u16, (width * 0.35) as u16, (width * 0.2) as u16, (width * 0.2) as u16]) + .widths(&[ + Constraint::Length((width * 0.2) as u16), + Constraint::Length((width * 0.35) as u16), + Constraint::Length((width * 0.2) as u16), + Constraint::Length((width * 0.2) as u16), + ]) .render(&mut f, bottom_chunks[1]); } } |