fix(color): 'SWITCH' widget option logic, enable for Lua widgets (#4190)

This commit is contained in:
philmoz
2023-10-17 07:22:25 +10:00
committed by GitHub
parent 4128b762dd
commit 1e3f919146
3 changed files with 15 additions and 10 deletions
+5 -6
View File
@@ -154,14 +154,13 @@ WidgetSettings::WidgetSettings(Window* parent, Widget* widget) :
case ZoneOption::Switch:
new SwitchChoice(
line, rect_t{},
option.min.unsignedValue, // min
option.max.unsignedValue, // max
[=]() -> int16_t { // getValue
return (uint8_t)widget->getOptionValue(optIdx)->unsignedValue;
option.min.signedValue, // min
option.max.signedValue, // max
[=]() -> int16_t { // getValue
return widget->getOptionValue(optIdx)->signedValue;
},
[=](int16_t newValue) { // setValue
widget->getOptionValue(optIdx)->unsignedValue =
(uint32_t)newValue;
widget->getOptionValue(optIdx)->signedValue = newValue;
SET_DIRTY();
});
break;