fix(color): Toggle switch not valid for pre-start checks (#4293)
This commit is contained in:
@@ -201,12 +201,12 @@ static std::string switchWarninglabel(swsrc_t index)
|
|||||||
#define SW_BTN_W ((LCD_W-24)/SW_BTNS)
|
#define SW_BTN_W ((LCD_W-24)/SW_BTNS)
|
||||||
|
|
||||||
SwitchWarnMatrix::SwitchWarnMatrix(Window* parent, const rect_t& r) :
|
SwitchWarnMatrix::SwitchWarnMatrix(Window* parent, const rect_t& r) :
|
||||||
ButtonMatrix(parent, r)
|
ButtonMatrix(parent, r)
|
||||||
{
|
{
|
||||||
// Setup button layout & texts
|
// Setup button layout & texts
|
||||||
uint8_t btn_cnt = 0;
|
uint8_t btn_cnt = 0;
|
||||||
for (uint8_t i = 0; i < MAX_SWITCHES; i++) {
|
for (uint8_t i = 0; i < MAX_SWITCHES; i++) {
|
||||||
if (SWITCH_EXISTS(i)) {
|
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||||
sw_idx[btn_cnt] = i;
|
sw_idx[btn_cnt] = i;
|
||||||
btn_cnt++;
|
btn_cnt++;
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ SwitchWarnMatrix::SwitchWarnMatrix(Window* parent, const rect_t& r) :
|
|||||||
|
|
||||||
uint8_t btn_id = 0;
|
uint8_t btn_id = 0;
|
||||||
for (uint8_t i = 0; i < MAX_SWITCHES; i++) {
|
for (uint8_t i = 0; i < MAX_SWITCHES; i++) {
|
||||||
if (SWITCH_EXISTS(i)) {
|
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||||
setTextAndState(btn_id);
|
setTextAndState(btn_id);
|
||||||
btn_id++;
|
btn_id++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user