FrSkyRC / ETHOS-Feedback-Community

Feedback & suggestions are welcomed here for ETHOS by FrSky
187 stars 84 forks source link

Lua - More Flexible "steps" function for form field #4540

Open BladeScraper-Designs opened 6 hours ago

BladeScraper-Designs commented 6 hours ago

The field:step function could be expanded to have configurable steps in a field number entry. Something like this:

field:steps({10, 25, 100}, 10, true)

Where {10, 25, 100} is a table of available steps and 10 is default step value and true/false decides whether the default steps are disabled (leaving only the ones set up in the table)

and if custom steps are not needed, field:steps(nil, 10, nil) or could simply use existing function (to maintain backward compatibility with Luas that use it): field:step(10)

robthomson commented 5 hours ago

100% agreed.

In some cases it is not desirable to allow the step to be changed from what you set.

even a field:step(10,) type option to imply dont allow other steps would be usefull!