Speed up bulk menu addition. (#2516)
* Speed up bulk menu bar addition. * libopenui reference
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[submodule "libopenui"]
|
[submodule "libopenui"]
|
||||||
path = radio/src/thirdparty/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"]
|
[submodule "radio/src/thirdparty/AccessDenied"]
|
||||||
path = radio/src/thirdparty/AccessDenied
|
path = radio/src/thirdparty/AccessDenied
|
||||||
url = https://github.com/raphaelcoeffic/AccessDenied.git
|
url = https://github.com/raphaelcoeffic/AccessDenied.git
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ void ModelCurvesPage::build(FormWindow * window, int8_t focusIndex)
|
|||||||
for (int angle = -45; angle <= 45; angle += 15) {
|
for (int angle = -45; angle <= 45; angle += 15) {
|
||||||
char label[16];
|
char label[16];
|
||||||
strAppend(strAppendSigned(label, angle), "°");
|
strAppend(strAppendSigned(label, angle), "°");
|
||||||
menu->addLine(label, [=]() {
|
menu->addLineBuffered(label, [=]() {
|
||||||
int dx = 2000 / (5 + curve.points - 1);
|
int dx = 2000 / (5 + curve.points - 1);
|
||||||
for (uint8_t i = 0; i < 5 + curve.points; i++) {
|
for (uint8_t i = 0; i < 5 + curve.points; i++) {
|
||||||
int x = -1000 + i * dx;
|
int x = -1000 + i * dx;
|
||||||
@@ -348,6 +348,7 @@ void ModelCurvesPage::build(FormWindow * window, int8_t focusIndex)
|
|||||||
rebuild(window, index);
|
rebuild(window, index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
menu->updateLines();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isCurveUsed(index)) {
|
if (isCurveUsed(index)) {
|
||||||
|
|||||||
@@ -421,9 +421,10 @@ void ModelMixesPage::newMix()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::string ch_name(getSourceString(MIXSRC_CH1 + ch));
|
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)
|
void ModelMixesPage::editMix(uint8_t channel, uint8_t index)
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ void ModelsPageBody::editLabels(ModelCell* model)
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (auto &label : modelslabels.getLabels()) {
|
for (auto &label : modelslabels.getLabels()) {
|
||||||
menu->addLine(
|
menu->addLineBuffered(
|
||||||
label,
|
label,
|
||||||
[=]() {
|
[=]() {
|
||||||
if (!modelslabels.isLabelSelected(label, model))
|
if (!modelslabels.isLabelSelected(label, model))
|
||||||
@@ -453,6 +453,7 @@ void ModelsPageBody::editLabels(ModelCell* model)
|
|||||||
},
|
},
|
||||||
[=]() { return modelslabels.isLabelSelected(label, model); });
|
[=]() { return modelslabels.isLabelSelected(label, model); });
|
||||||
}
|
}
|
||||||
|
menu->updateLines();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ void ModelSetupPage::build(FormWindow * window)
|
|||||||
Menu *menu = new Menu(window, true);
|
Menu *menu = new Menu(window, true);
|
||||||
menu->setTitle(STR_LABELS);
|
menu->setTitle(STR_LABELS);
|
||||||
for (auto &label: modelslabels.getLabels()) {
|
for (auto &label: modelslabels.getLabels()) {
|
||||||
menu->addLine(label,
|
menu->addLineBuffered(label,
|
||||||
[=] () {
|
[=] () {
|
||||||
if (!modelslabels.isLabelSelected(label, curmod))
|
if (!modelslabels.isLabelSelected(label, curmod))
|
||||||
modelslabels.addLabelToModel(label, curmod);
|
modelslabels.addLabelToModel(label, curmod);
|
||||||
@@ -261,6 +261,7 @@ void ModelSetupPage::build(FormWindow * window)
|
|||||||
return modelslabels.isLabelSelected(label, curmod);
|
return modelslabels.isLabelSelected(label, curmod);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
menu->updateLines();
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: e798fb3949...e9caef9624
Reference in New Issue
Block a user