fix(cpn): topbar zones count and initialisation (#7147)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user