diff --git a/src/tui/render.rs b/src/tui/render.rs index a3a3f3a..6b3e6d3 100644 --- a/src/tui/render.rs +++ b/src/tui/render.rs @@ -206,7 +206,8 @@ impl App { .alignment(Alignment::Right), ) .border_type(BORDER_STYLE.to_border_type()) - .border_style(Style::default().fg(theme.accent())); + .border_style(Style::default().fg(theme.accent())) + .style(Style::default().bg(theme.background())); if let Some(sl) = self.log_overlay_search.title_line() { block = block.title_top(sl); @@ -394,7 +395,7 @@ fn render_provider_conflict(frame: &mut Frame, conflict: &super::app::ProviderCo .border_type(BORDER_STYLE.to_border_type()) .border_style(Style::default().fg(theme.accent())), ) - .style(Style::default().fg(theme.text()).bg(theme.background())) + .style(Style::default().fg(theme.text()).bg(theme.surface())) .highlight_style( Style::default() .fg(theme.accent()) diff --git a/src/tui/tests/widgets/account.rs b/src/tui/tests/widgets/account.rs index 8beba4d..5518ad3 100644 --- a/src/tui/tests/widgets/account.rs +++ b/src/tui/tests/widgets/account.rs @@ -1,4 +1,5 @@ use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; +use ratatui::{Terminal, backend::TestBackend}; use super::*; @@ -24,3 +25,23 @@ fn offline_account_requires_a_microsoft_account_and_can_be_dismissed() { assert!(handle_key(&key(KeyCode::Esc), &mut state)); assert!(matches!(state.add_mode, AddMode::None)); } + +#[test] +fn account_type_popup_uses_the_theme_surface() { + let temp = tempfile::tempdir().unwrap(); + let mut state = AccountState { + store: AccountStore::empty_for_test(temp.path().join("accounts.json")), + list_state: Default::default(), + add_mode: AddMode::ChooseType, + }; + let mut terminal = Terminal::new(TestBackend::new(60, 12)).unwrap(); + + terminal + .draw(|frame| render(frame, frame.area(), FocusedArea::Account, &mut state)) + .unwrap(); + + assert_eq!( + terminal.backend().buffer().cell((11, 3)).unwrap().bg, + THEME.as_ref().surface() + ); +} diff --git a/src/tui/tests/widgets/popups/import_modpack/render.rs b/src/tui/tests/widgets/popups/import_modpack/render.rs index 1559958..50812cf 100644 --- a/src/tui/tests/widgets/popups/import_modpack/render.rs +++ b/src/tui/tests/widgets/popups/import_modpack/render.rs @@ -47,6 +47,10 @@ fn modpack_discovery_renders_active_search() { assert!(rendered.contains("/ fabric\u{2588}")); assert!(rendered.contains("[v] versions")); assert!(rendered.contains("[i] import")); + assert_eq!( + terminal.backend().buffer().cell((1, 1)).unwrap().bg, + crate::config::theme::THEME.as_ref().surface() + ); } #[test] diff --git a/src/tui/widgets/account.rs b/src/tui/widgets/account.rs index 2a5d920..5e9c35e 100644 --- a/src/tui/widgets/account.rs +++ b/src/tui/widgets/account.rs @@ -353,7 +353,7 @@ fn render_choose_popup(frame: &mut Frame) { PopupFrame { title: Line::from(" Add Account ").centered(), border_color, - bg: None, + bg: Some(theme.surface()), keybinds: Some(Line::from(Span::styled( " Esc: cancel ", Style::default().fg(dim_color), diff --git a/src/tui/widgets/popups/import_modpack/render.rs b/src/tui/widgets/popups/import_modpack/render.rs index 483f98c..4400860 100644 --- a/src/tui/widgets/popups/import_modpack/render.rs +++ b/src/tui/widgets/popups/import_modpack/render.rs @@ -130,7 +130,8 @@ fn render_discovery(frame: &mut Frame, area: Rect, picker: &ratatui_image::picke ) .borders(Borders::ALL) .border_type(BORDER_STYLE.to_border_type()) - .border_style(Style::default().fg(theme.accent())); + .border_style(Style::default().fg(theme.accent())) + .style(Style::default().bg(theme.surface())); if let Some(search_line) = state.search.title_line() { block = block.title_top(search_line); }