fix(color): Long press and filtering in Switch Choice popup (#4362)

This commit is contained in:
philmoz
2023-11-27 22:02:41 +10:00
committed by GitHub
parent 2c3686882c
commit 3971a70d26
4 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ void Choice::fillMenu(Menu* menu, const FilterFct& filter)
selectedIx0 = -1;
for (int i = vmin; i <= vmax; ++i) {
if (filter && !filter(i)) continue;
if (isValueAvailable && !isValueAvailable(i)) continue;
if (isValueAvailable && !isValueAvailable(inverted ? -i : i)) continue;
if (textHandler) {
menu->addLineBuffered(textHandler(i), [=]() { setValue(i); });
} else if (unsigned(i - vmin) < values.size()) {
+2
View File
@@ -181,6 +181,8 @@ class Choice : public ChoiceBase
protected:
friend class MenuToolbar;
bool inverted = false;
std::string getLabelText() override;
std::vector<std::string> values;
int vmin = 0;