fix(color): momentaryButton in Lua script crashes radio (#6460)
This commit is contained in:
@@ -1791,19 +1791,6 @@ void LvglWidgetTextButtonBase::clearRefs(lua_State *L)
|
||||
LvglWidgetObject::clearRefs(L);
|
||||
}
|
||||
|
||||
void LvglWidgetTextButtonBase::setText(const char *s)
|
||||
{
|
||||
if (window && txt.changedText(s)) {
|
||||
((TextButton *)window)->setText(s);
|
||||
}
|
||||
}
|
||||
|
||||
void LvglWidgetTextButtonBase::setFont(LcdFlags newFont)
|
||||
{
|
||||
if (window && font.changedFont(newFont))
|
||||
((TextButton*)window)->setFont(FONT_INDEX(font.flags));
|
||||
}
|
||||
|
||||
void LvglWidgetTextButtonBase::setSize(coord_t w, coord_t h)
|
||||
{
|
||||
if (w == LV_SIZE_CONTENT || w == 0) w = lv_obj_get_width(window->getLvObj());
|
||||
@@ -1859,6 +1846,19 @@ void LvglWidgetTextButton::setChecked(bool checked)
|
||||
((TextButton*)window)->check(checked);
|
||||
}
|
||||
|
||||
void LvglWidgetTextButton::setText(const char *s)
|
||||
{
|
||||
if (window && txt.changedText(s)) {
|
||||
((TextButton *)window)->setText(s);
|
||||
}
|
||||
}
|
||||
|
||||
void LvglWidgetTextButton::setFont(LcdFlags newFont)
|
||||
{
|
||||
if (window && font.changedFont(newFont))
|
||||
((TextButton*)window)->setFont(FONT_INDEX(font.flags));
|
||||
}
|
||||
|
||||
void LvglWidgetTextButton::build(lua_State *L)
|
||||
{
|
||||
if (h == LV_SIZE_CONTENT) h = 0;
|
||||
@@ -1896,6 +1896,19 @@ void LvglWidgetMomentaryButton::clearRefs(lua_State *L)
|
||||
LvglWidgetTextButtonBase::clearRefs(L);
|
||||
}
|
||||
|
||||
void LvglWidgetMomentaryButton::setText(const char *s)
|
||||
{
|
||||
if (window && txt.changedText(s)) {
|
||||
((MomentaryButton *)window)->setText(s);
|
||||
}
|
||||
}
|
||||
|
||||
void LvglWidgetMomentaryButton::setFont(LcdFlags newFont)
|
||||
{
|
||||
if (window && font.changedFont(newFont))
|
||||
((MomentaryButton*)window)->setFont(FONT_INDEX(font.flags));
|
||||
}
|
||||
|
||||
void LvglWidgetMomentaryButton::build(lua_State *L)
|
||||
{
|
||||
if (h == LV_SIZE_CONTENT) h = 0;
|
||||
|
||||
Reference in New Issue
Block a user