From 3b5ee67114bf789c93db23b7a3611302dce7142e Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 29 May 2023 16:44:50 +0200 Subject: Add initial theming support --- src/settings.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/settings.c') diff --git a/src/settings.c b/src/settings.c index fca5696..15d4bdf 100644 --- a/src/settings.c +++ b/src/settings.c @@ -8,9 +8,9 @@ void draw_settings_cursor(void) { int x = 6; int y = 17 + settings_cursor_loc * 12; - draw_line(x + 1, y + 3, x + 1, y + 7, COL_CYAN); - draw_line(x + 2, y + 4, x + 2, y + 6, COL_CYAN); - draw_line(x + 3, y + 5, x + 3, y + 5, COL_CYAN); + draw_line(x + 1, y + 3, x + 1, y + 7, COL_ACC_0); + draw_line(x + 2, y + 4, x + 2, y + 6, COL_ACC_0); + draw_line(x + 3, y + 5, x + 3, y + 5, COL_ACC_0); } void @@ -40,6 +40,14 @@ handle_settings_input(void) { settings.sync++; } } break; + case 1: { + if ((settings.theme + 1) >= THEME_NUM) { + settings.theme = 0; + } else { + settings.theme++; + } + swap_palette(settings.theme); + } break; } save_metadata(); clear_screen = true; @@ -53,6 +61,14 @@ handle_settings_input(void) { settings.sync--; } } break; + case 1: { + if (settings.theme == 0) { + settings.theme = THEME_NUM - 1; + } else { + settings.theme--; + } + swap_palette(settings.theme); + } break; } save_metadata(); clear_screen = true; -- cgit v1.2.1