Skip to content

Commit e1e08eb

Browse files
fix: use reverse video for TUI highlight style (closes #139) (#146)
Replace bg(Color::DarkGray) with Modifier::REVERSED in highlight_style so the selected-row highlight adapts to both light and dark terminal themes. Co-authored-by: jpoehnelt-bot <jpoehnelt-bot@users.noreply.github.com>
1 parent b9c3698 commit e1e08eb

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@googleworkspace/cli": patch
3+
---
4+
5+
Fix highlight color on light terminal themes by using reverse video instead of a dark-gray background

‎src/setup_tui.rs‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,7 @@ fn run_picker_loop(
405405
.collect();
406406

407407
let list = List::new(items)
408-
.highlight_style(
409-
Style::default()
410-
.bg(Color::DarkGray)
411-
.add_modifier(Modifier::BOLD),
412-
)
408+
.highlight_style(Style::default().add_modifier(Modifier::REVERSED | Modifier::BOLD))
413409
.highlight_symbol("▸ ");
414410

415411
frame.render_stateful_widget(list, chunks[1], &mut state.list_state);
@@ -806,11 +802,7 @@ impl SetupWizard {
806802
.borders(Borders::ALL)
807803
.border_style(Style::default().fg(Color::DarkGray)),
808804
)
809-
.highlight_style(
810-
Style::default()
811-
.bg(Color::DarkGray)
812-
.add_modifier(Modifier::BOLD),
813-
)
805+
.highlight_style(Style::default().add_modifier(Modifier::REVERSED | Modifier::BOLD))
814806
.highlight_symbol("▸ ");
815807

816808
frame.render_stateful_widget(list, area, &mut picker.list_state);

0 commit comments

Comments
 (0)