mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 19:56:40 +00:00
Search cleanup, more binder support (#1467)
This commit is contained in:
@@ -52,6 +52,15 @@ struct NoOp {
|
||||
* adequate lifetime of the referenced instances.
|
||||
*/
|
||||
|
||||
template <typename T, typename Fn = NoOp>
|
||||
void bind(Checkbox& check, T& value, Fn fn = Fn{}) {
|
||||
check.set_value(value);
|
||||
check.on_select = [&value, fn](Checkbox&, bool b) {
|
||||
value = b;
|
||||
fn(value);
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T, typename Fn = NoOp>
|
||||
void bind(NumberField& field, T& value, Fn fn = Fn{}) {
|
||||
field.set_value(value);
|
||||
|
Reference in New Issue
Block a user