Public Access
UI: seven themes, each dark and light, chosen in the Settings
Settings > Theme and Settings > Light or dark pick the colours of every screen (issue #10): roro9stack (the website's, the default), Catppuccin, Dracula, Nord, ANSI terminal, Gruvbox and Solarized. - A palette is 14 roles (lib/ui/src/palette.h). theme::kText and the others are now references into the one in use, so the Apps are unchanged; the main loop applies it when a Setting changes. - Every colour is one the RGB332 frame buffer holds exactly: the themes' own were rounded, and those that fell together or lost contrast were picked by hand. test_palette checks exactness and 18 contrast ratios for each palette. - The Sky view's constellation colours come from the theme. - `theme [0-6] [light|dark]` on the consoles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
@@ -46,6 +46,21 @@ void test_toggle_rows_flip_on_select() {
|
||||
TEST_ASSERT_FALSE(f.settings.getBool(Setting::Sound));
|
||||
}
|
||||
|
||||
void test_the_theme_and_its_side() {
|
||||
Fixture f;
|
||||
int theme = f.row(SettingsMenu::Row::Theme), side = f.row(SettingsMenu::Row::ThemeLight);
|
||||
TEST_ASSERT_EQUAL_STRING("roro9stack", f.menu.value(theme).c_str());
|
||||
TEST_ASSERT_EQUAL(7, static_cast<int>(f.menu.choices(theme).size()));
|
||||
TEST_ASSERT_EQUAL(0, f.menu.currentChoice(theme));
|
||||
TEST_ASSERT_EQUAL_STRING("", f.menu.choose(theme, 2).c_str());
|
||||
TEST_ASSERT_EQUAL_INT32(2, f.settings.getInt(Setting::Theme));
|
||||
TEST_ASSERT_EQUAL_STRING("Dracula", f.menu.value(theme).c_str());
|
||||
TEST_ASSERT_EQUAL_STRING("Dark", f.menu.value(side).c_str());
|
||||
f.menu.toggle(side);
|
||||
TEST_ASSERT_TRUE(f.settings.getBool(Setting::ThemeLight));
|
||||
TEST_ASSERT_EQUAL_STRING("Light", f.menu.value(side).c_str());
|
||||
}
|
||||
|
||||
void test_the_launcher_is_a_grid_or_a_list() {
|
||||
Fixture f;
|
||||
int launcher = f.row(SettingsMenu::Row::Launcher);
|
||||
@@ -171,6 +186,7 @@ int main() {
|
||||
RUN_TEST(test_values_are_human_readable);
|
||||
RUN_TEST(test_toggle_rows_flip_on_select);
|
||||
RUN_TEST(test_the_launcher_is_a_grid_or_a_list);
|
||||
RUN_TEST(test_the_theme_and_its_side);
|
||||
RUN_TEST(test_choice_rows_list_options_and_mark_the_current_one);
|
||||
RUN_TEST(test_choosing_applies_the_setting);
|
||||
RUN_TEST(test_choice_that_breaks_a_rule_is_refused_with_a_reason);
|
||||
|
||||
Reference in New Issue
Block a user