feat: begin adding settings menu, move theme to settings

This commit is contained in:
frosty
2026-03-30 10:37:46 +03:00
parent 9e6e763064
commit c3ed901738
18 changed files with 444 additions and 19 deletions

View File

@@ -1,4 +1,7 @@
#include "Utility.h"
#include <beaker.h>
#include <stdlib.h>
#include <string.h>
int hex_to_int(char c) {
if (c >= '0' && c <= '9')
@@ -9,3 +12,14 @@ int hex_to_int(char c) {
return c - 'A' + 10;
return -1;
}
char *get_theme(const char *default_theme) {
char *cookie = get_cookie("theme");
if (cookie &&
(strcmp(cookie, "light") == 0 ||
strcmp(cookie, "dark") == 0)) {
return cookie;
}
free(cookie);
return strdup(default_theme);
}