Skip to content

Commit

Permalink
Adjust live position for smaller screen
Browse files Browse the repository at this point in the history
  • Loading branch information
aldidana committed Oct 31, 2020
1 parent d75ecf2 commit bb3feeb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# F1 Telemetry TUI

> 🏎️ Terminal Telemetry for F1 Video Games 🏎️
### License
MIT @Aldi Priya Perdana
22 changes: 11 additions & 11 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ impl App {
.margin(1)
.constraints(
[
Constraint::Percentage(35), // car status
Constraint::Percentage(40), // car status
Constraint::Percentage(10), // rev light
Constraint::Percentage(10), // rev light
Constraint::Percentage(10), // rev light
Constraint::Percentage(35), // car telemetry
Constraint::Percentage(30), // car telemetry
]
.as_ref(),
)
Expand All @@ -264,7 +264,7 @@ impl App {
.margin(1)
.direction(Direction::Horizontal)
.constraints(
[Constraint::Percentage(50), Constraint::Percentage(50)].as_ref(),
[Constraint::Percentage(70), Constraint::Percentage(30)].as_ref(),
)
.split(left_layout[0]);

Expand Down Expand Up @@ -458,7 +458,7 @@ impl App {
});

let live_position = Table::new(
["P", "Driver", "Lap", "Last Lap", "Best Lap", "Tyre"].iter(),
["P", "Driver", "L", "Last Lap", "Best Lap", "Tyre"].iter(),
positions.clone().into_iter(),
)
.block(
Expand All @@ -467,15 +467,15 @@ impl App {
.title("Live Position"),
)
.widths(&[
Constraint::Length(2),
Constraint::Length(10),
Constraint::Length(3),
Constraint::Length(8),
Constraint::Length(8),
Constraint::Length(5),
Constraint::Percentage(5),
Constraint::Percentage(20),
Constraint::Percentage(5),
Constraint::Percentage(15),
Constraint::Percentage(15),
Constraint::Percentage(15),
])
.style(Style::default().fg(Color::White))
.column_spacing(5);
.column_spacing(3);

f.render_widget(live_position, right_layout[0]);
})
Expand Down

0 comments on commit bb3feeb

Please sign in to comment.