fix(color): lvgl.clear() not working correctly for Lua child layouts (#6030)

This commit is contained in:
philmoz
2025-03-29 10:36:37 +10:00
committed by GitHub
parent fba973e947
commit f5dd5c1f17
2 changed files with 14 additions and 5 deletions
+13 -4
View File
@@ -321,14 +321,18 @@ void LvglWidgetObjectBase::parseParam(lua_State *L, const char *key)
}
}
void LvglWidgetObjectBase::clear()
{
clearRequest = true;
if (getWindow())
getWindow()->clear();
}
bool LvglWidgetObjectBase::callRefs(lua_State *L)
{
if (clearRequest) {
clearRequest = false;
if (getWindow()) {
getWindow()->clear();
clearChildRefs(L);
}
clearChildRefs(L);
return true;
}
@@ -352,6 +356,11 @@ bool LvglWidgetObjectBase::callRefs(lua_State *L)
auto p = LvglWidgetObjectBase::checkLvgl(L, -1);
lua_pop(L, 1);
if (p) if (!p->callRefs(L)) return false;
if (clearRequest) {
clearRequest = false;
clearChildRefs(L);
return true;
}
}
return true;
+1 -1
View File
@@ -82,7 +82,7 @@ class LvglWidgetObjectBase
static LvglWidgetObjectBase *checkLvgl(lua_State *L, int index);
void clear() { clearRequest = true; }
void clear();
protected:
int luaRef = LUA_REFNIL;