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:
+2
-2
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user