fix(cpn): Widget name truncation, top bar widget cfg lost if more than 4 (#4584)

This commit is contained in:
Neil Horne
2024-02-05 11:23:54 +10:00
committed by GitHub
parent a40c2b8377
commit 7e706b73d5
3 changed files with 13 additions and 6 deletions
@@ -132,9 +132,16 @@ bool RadioLayout::CustomScreenData::isEmpty() const
return strlen(layoutId) == 0;
}
void RadioLayout::CustomScreens::clear()
{
for (int i = 0; i < MAX_CUSTOM_SCREENS; i++) {
customScreenData[i] = CustomScreenData();
}
}
void RadioLayout::init(const char* layoutId, CustomScreens& customScreens)
{
memset(&customScreens, 0, sizeof(CustomScreens));
customScreens.clear();
for (int i = 0; i < MAX_CUSTOM_SCREENS; i++) {
if (i == 0)