Fix colors in the help box
When the lines of the help box overlap with disabled or error'd ports you might notice that those lines are dark grey or red. That's surprising! The bug is that Style::default() means "don't change anything", just continue being whatever color the current cell is, which is deeply surprising. What we really want here is `Style::reset()`, which means "reset the colors to whatever the terminal would show by default."
This commit is contained in:
parent
b381f71692
commit
4fe255e7d2
1 changed files with 5 additions and 4 deletions
|
|
@ -323,10 +323,10 @@ impl UI {
|
|||
}
|
||||
|
||||
fn render_ports(&mut self, frame: &mut Frame, size: Rect) {
|
||||
let enabled_port_style = Style::default();
|
||||
let disabled_port_style = Style::default().fg(Color::DarkGray);
|
||||
let enabled_port_style = Style::reset();
|
||||
let disabled_port_style = Style::reset().fg(Color::DarkGray);
|
||||
let broken_port_style =
|
||||
Style::default().fg(Color::Red).add_modifier(Modifier::DIM);
|
||||
Style::reset().fg(Color::Red).add_modifier(Modifier::DIM);
|
||||
|
||||
let mut rows = Vec::new();
|
||||
let ports = self.get_ui_ports();
|
||||
|
|
@ -399,7 +399,8 @@ impl UI {
|
|||
];
|
||||
let keybindings = Table::new(keybindings, keybindings_widths)
|
||||
.column_spacing(1)
|
||||
.block(Block::default().title("Keys").borders(Borders::ALL));
|
||||
.block(Block::default().title("Keys").borders(Borders::ALL))
|
||||
.style(Style::reset());
|
||||
|
||||
// keybindings
|
||||
frame.render_widget(keybindings, inner_area);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue