fix(cpn): topbar zones count and initialisation (#7147)

This commit is contained in:
Neil Horne
2026-03-15 13:18:03 +10:00
committed by GitHub
parent cef0a87971
commit 8a9b52bd97
8 changed files with 89 additions and 9 deletions
@@ -147,7 +147,12 @@ UserInterfacePanel::UserInterfacePanel(QWidget * parent, ModelData & model, Gene
QGridLayout * tbgrid = new QGridLayout();
for (int i = 0; i < firmware->getCapability(TopBarZones); i++) {
const int zones = firmware->getCapability(TopBarZones);
int usedzones = 0;
for (int i = 0; i < zones; i++) {
if (usedzones >= zones) break;
usedzones += model.topbarWidgetWidth[i];
ZonePersistentData & zpd = model.topBarData.zones[i];
QPushButton * btn = new QPushButton(zpd.widgetName.c_str(), this);
btn->setProperty("index", i);