diff options
| author | historia <historiavg@proton.me> | 2026-08-25 14:52:30 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-25 14:52:30 -0400 |
| commit | fca3431721a55277f139efc83df2438207917448 (patch) | |
| tree | 1d64aec465db7fa1d5098bc56c11ea70ab6b682d /app/tests/test_tui.py | |
| parent | 061406b608c5a77b33259506648e0166367b2b9f (diff) | |
| download | tts-audiobook-generator-fca3431721a55277f139efc83df2438207917448.tar.gz | |
feat: clearer colors for buttons
Diffstat (limited to 'app/tests/test_tui.py')
| -rw-r--r-- | app/tests/test_tui.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/tests/test_tui.py b/app/tests/test_tui.py index 030b668..964f983 100644 --- a/app/tests/test_tui.py +++ b/app/tests/test_tui.py @@ -58,6 +58,7 @@ class FakeCurses: def __init__(self): self.pairs = {} # pair number -> (fg, bg) self.colors = True + self.COLORS = 256 def has_colors(self): return self.colors @@ -167,6 +168,14 @@ class ThemeTests(TuiTestCase): self.assertEqual((fg, bg), (FakeCurses.COLOR_BLACK, FakeCurses.COLOR_GREEN)) + def test_inactive_button_is_white_on_dark_gray(self): + frame = tui.Frame(self.screen, "Title", "footer") + theme, pairs = frame.theme, self.curses.pairs + fg, bg = pairs[theme["btn_off"] >> 8] + self.assertEqual((fg, bg), + (FakeCurses.COLOR_WHITE, 236)) + self.assertFalse(theme["btn_off"] & FakeCurses.A_BOLD) + def test_without_colors_theme_uses_plain_attributes(self): self.curses.colors = False frame = tui.Frame(self.screen, "Title", "footer") @@ -261,7 +270,7 @@ class MenuTests(TuiTestCase): screen = FakeScreen(keys=[10]) tui.menu(screen, "Pick", self.OPTIONS) x0, _ = self.dialog_box(screen) - arrow_x = x0 + 1 + tui.Frame.LIST_MARGIN - 1 + arrow_x = x0 + 1 + tui.Frame.LIST_MARGIN - 2 arrows = [(y, x) for y, x, ch, _ in screen.chars if ch == FakeCurses.ACS_RARROW] y_first = next(y for y, _, text, _ in screen.strings @@ -273,7 +282,7 @@ class MenuTests(TuiTestCase): screen = FakeScreen(keys=[FakeCurses.KEY_DOWN, 10]) tui.menu(screen, "Pick", self.OPTIONS) x0, _ = self.dialog_box(screen) - arrow_x = x0 + 1 + tui.Frame.LIST_MARGIN - 1 + arrow_x = x0 + 1 + tui.Frame.LIST_MARGIN - 2 arrows = [y for y, x, ch, _ in screen.chars if ch == FakeCurses.ACS_RARROW and x == arrow_x] y_first = next(y for y, _, text, _ in screen.strings |
