feat(color): allow changing the size of topbar widgets (#5235)
This commit is contained in:
@@ -1179,6 +1179,9 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
if (topbarData && topbarData.IsMap()) {
|
||||
node["topbarData"] = topbarData;
|
||||
}
|
||||
for (int i = 0; i < MAX_TOPBAR_ZONES; i += 1)
|
||||
if (rhs.topbarWidgetWidth[i] > 0)
|
||||
node["topbarWidgetWidth"][std::to_string(i)]["val"] = (int)rhs.topbarWidgetWidth[i];
|
||||
node["view"] = rhs.view;
|
||||
}
|
||||
|
||||
@@ -1447,8 +1450,15 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
|
||||
|
||||
node["screenData"] >> rhs.customScreens.customScreenData;
|
||||
node["topbarData"] >> rhs.topBarData;
|
||||
|
||||
if (node["topbarWidgetWidth"]) {
|
||||
for (int i = 0; i < MAX_TOPBAR_ZONES; i += 1) {
|
||||
if (node["topbarWidgetWidth"][std::to_string(i)]) {
|
||||
node["topbarWidgetWidth"][std::to_string(i)]["val"] >> rhs.topbarWidgetWidth[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
node["view"] >> rhs.view;
|
||||
|
||||
node["modelRegistrationID"] >> rhs.registrationId;
|
||||
node["hatsMode"] >> hatsModeLut >> rhs.hatsMode;
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@ class ModelData {
|
||||
|
||||
RadioLayout::CustomScreens customScreens;
|
||||
TopBarPersistentData topBarData;
|
||||
uint8_t topbarWidgetWidth[MAX_TOPBAR_ZONES];
|
||||
unsigned int view;
|
||||
|
||||
char registrationId[8+1];
|
||||
|
||||
Reference in New Issue
Block a user