From 88ea481015a4fc3891224cb7379bc3959aa5ad1e Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 25 Aug 2023 08:33:16 +0200 Subject: Update UI for settings page --- src/main.c | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c424d9c..ae14d87 100644 --- a/src/main.c +++ b/src/main.c @@ -129,14 +129,49 @@ render_sequencer(void) { void render_settings(void) { - txt_drawf_small("settings", 11, 5, COL_FG) - txt_printf("\n\n\n"); - txt_printf(" SYNC: %s\n\n", sync_setting_str[settings.sync]); - txt_printf(" THEME: %s\n\n", theme_setting_str[settings.theme]); - txt_printf(" CURSOR: %s\n\n", cursor_setting_str[settings.cursor]); - txt_printf(" HELP: %s\n\n", help_setting_str[settings.help]); - txt_render(); - txt_clear(); + size_t x0 = 8; + size_t x1 = x0 + 64; + size_t y0 = 6; + + // Header. + txt_drawf("SETTINGS", x0, y0, COL_FG) + draw_wrench(SCREEN_WIDTH - 32, y0, COL_FG); + y0 = 16; + draw_filled_rect(x0, y0 - 1, SCREEN_WIDTH - 9, y0, COL_FG); + y0 = 20; + + // Globals. + txt_drawf("GLOBAL", x0, y0, COL_FG); + draw_line(x0, y0 + 9, SCREEN_WIDTH - 9, y0 + 9, COL_FG); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("MUTE", x0 + 2, y0 + 1, COL_FG); + txt_drawf("OFF", x1 + 8, y0 + 1, COL_FG); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("BPM", x0 + 2, y0 + 1, COL_FG); + txt_drawf("OFF", x1 + 8, y0 + 1, COL_FG); + y0 += 17; + + txt_drawf("GENERAL", x0, y0, COL_FG); + draw_line(x0, y0 + 9, SCREEN_WIDTH - 9, y0 + 9, COL_FG); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("AUTO-SAVE", x0 + 2, y0 + 1, COL_FG); + txt_drawf("OFF", x1 + 8, y0 + 1, COL_FG); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("SYNC", x0 + 2, y0 + 1, COL_FG); + txt_drawf("%s", x1 + 8, y0 + 1, COL_FG, sync_setting_str[settings.sync]); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("THEME", x0 + 2, y0 + 1, COL_FG); + txt_drawf("%s", x1 + 8, y0 + 1, COL_FG, theme_setting_str[settings.theme]); + y0 += 17; + draw_rect(x0, y0, x1, y0 + 10, COL_FG); + txt_drawf("HELP", x0 + 2, y0 + 1, COL_FG); + txt_drawf("%s", x1 + 8, y0 + 1, COL_FG, help_setting_str[settings.help]); + PROF(draw_settings_cursor(), draw_cursor_cycles); } -- cgit v1.2.1