fix(bw): use small switch layout when more than 6 switches (#4997)

This commit is contained in:
philmoz
2024-05-15 10:44:23 +10:00
committed by GitHub
parent 220d1b22f1
commit 7361302601
+2 -7
View File
@@ -588,15 +588,10 @@ void menuMainView(event_t event)
} }
} }
if (configured_switches < 9) { if (configured_switches < 7) {
for (int i = 0; i < switches; ++i) { for (int i = 0; i < switches; ++i) {
if (SWITCH_EXISTS(i) && !switchIsFlex(i)) { if (SWITCH_EXISTS(i) && !switchIsFlex(i)) {
auto switch_display = switchGetDisplayPosition(i); auto switch_display = switchGetDisplayPosition(i);
if (switch_display.row >= 3) {
drawSmallSwitch(switch_display.col == 0 ? 28 : 16 * FW + 1,
5 * FH + 1, 4, i);
}
else {
coord_t x = switch_display.col == 0 ? 3 * FW + 3 : 18 * FW + 1; coord_t x = switch_display.col == 0 ? 3 * FW + 3 : 18 * FW + 1;
coord_t y = 33 + switch_display.row * FH; coord_t y = 33 + switch_display.row * FH;
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i); getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
@@ -608,12 +603,12 @@ void menuMainView(event_t event)
} }
} }
} }
}
else { else {
for (int i = 0; i < switches; ++i) { for (int i = 0; i < switches; ++i) {
if (SWITCH_EXISTS(i) && !switchIsFlex(i)) { if (SWITCH_EXISTS(i) && !switchIsFlex(i)) {
auto switch_display = switchGetDisplayPosition(i); auto switch_display = switchGetDisplayPosition(i);
coord_t x = (switch_display.col == 0 ? 8 : 96) + switch_display.row * 5; coord_t x = (switch_display.col == 0 ? 8 : 96) + switch_display.row * 5;
if (configured_switches < 9) x += 3;
drawSmallSwitch(x, 5 * FH + 1, 4, i); drawSmallSwitch(x, 5 * FH + 1, 4, i);
} }
} }