Speed up bulk menu addition. (#2516)

* Speed up bulk menu bar addition.

* libopenui reference
This commit is contained in:
Gábor Bányász
2022-10-12 13:04:17 +10:00
committed by GitHub
parent 44add84b17
commit 867d627b39
6 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[submodule "libopenui"]
path = radio/src/thirdparty/libopenui
url = https://github.com/EdgeTX/libopenui.git
url = https://github.com/banyaszg/libopenui.git
[submodule "radio/src/thirdparty/AccessDenied"]
path = radio/src/thirdparty/AccessDenied
url = https://github.com/raphaelcoeffic/AccessDenied.git
+2 -1
View File
@@ -335,7 +335,7 @@ void ModelCurvesPage::build(FormWindow * window, int8_t focusIndex)
for (int angle = -45; angle <= 45; angle += 15) {
char label[16];
strAppend(strAppendSigned(label, angle), "°");
menu->addLine(label, [=]() {
menu->addLineBuffered(label, [=]() {
int dx = 2000 / (5 + curve.points - 1);
for (uint8_t i = 0; i < 5 + curve.points; i++) {
int x = -1000 + i * dx;
@@ -348,6 +348,7 @@ void ModelCurvesPage::build(FormWindow * window, int8_t focusIndex)
rebuild(window, index);
});
}
menu->updateLines();
};
if (isCurveUsed(index)) {
+2 -1
View File
@@ -421,9 +421,10 @@ void ModelMixesPage::newMix()
}
} else {
std::string ch_name(getSourceString(MIXSRC_CH1 + ch));
menu->addLine(ch_name.c_str(), [=]() { insertMix(ch, index); });
menu->addLineBuffered(ch_name.c_str(), [=]() { insertMix(ch, index); });
}
}
menu->updateLines();
}
void ModelMixesPage::editMix(uint8_t channel, uint8_t index)
+2 -1
View File
@@ -441,7 +441,7 @@ void ModelsPageBody::editLabels(ModelCell* model)
});
for (auto &label : modelslabels.getLabels()) {
menu->addLine(
menu->addLineBuffered(
label,
[=]() {
if (!modelslabels.isLabelSelected(label, model))
@@ -453,6 +453,7 @@ void ModelsPageBody::editLabels(ModelCell* model)
},
[=]() { return modelslabels.isLabelSelected(label, model); });
}
menu->updateLines();
}
}
+2 -1
View File
@@ -247,7 +247,7 @@ void ModelSetupPage::build(FormWindow * window)
Menu *menu = new Menu(window, true);
menu->setTitle(STR_LABELS);
for (auto &label: modelslabels.getLabels()) {
menu->addLine(label,
menu->addLineBuffered(label,
[=] () {
if (!modelslabels.isLabelSelected(label, curmod))
modelslabels.addLabelToModel(label, curmod);
@@ -261,6 +261,7 @@ void ModelSetupPage::build(FormWindow * window)
return modelslabels.isLabelSelected(label, curmod);
});
}
menu->updateLines();
return 0;
});