feat(settings): persist the theme through the settings binding

Keeps one writer for saved state: ui.setTheme() writes through
settings.setTheme() and then reloads the palette C cannot see.
This commit is contained in:
2026-08-04 20:44:13 -04:00
parent 9e58e72bf6
commit b3b5a9b2a3
9 changed files with 31 additions and 10 deletions
+2 -2
View File
@@ -69,8 +69,8 @@ bool Settings::load() {
lua_pcall(L, 0, 1, 0) == LUA_OK && lua_istable(L, -1);
if (ok) {
rotation = fieldOr(L, "rotation", rotation);
theme = stringFieldOr(L, "theme", theme);
timezone = stringFieldOr(L, "timezone", timezone);
theme = stringFieldOr(L, "theme", theme);
lua_getfield(L, -1, "touch");
if (lua_istable(L, -1)) {
touchX0 = fieldOr(L, "x0", touchX0);
@@ -92,8 +92,8 @@ bool Settings::load() {
bool Settings::save() const {
String source = "return {\n rotation = " + String(rotation) + ",\n";
source += " theme = " + luaString(theme) + ",\n";
source += " timezone = " + luaString(timezone) + ",\n";
source += " theme = " + luaString(theme) + ",\n";
source += " touch = { x0 = " + String(touchX0) +
", y0 = " + String(touchY0) + ", x1 = " + String(touchX1) +
", y1 = " + String(touchY1) + " },\n";