Fix touch screen menu buttons on non touch screen

This commit is contained in:
Just Call Me Koko
2025-05-07 18:44:23 -04:00
parent 3b479be94c
commit 9482a9dde2

View File

@@ -654,37 +654,39 @@ void MenuFunctions::buttonSelected(int b, int x) {
}
void MenuFunctions::displayMenuButtons() {
// Draw lines to show each menu button
for (int i = 0; i < 3; i++) {
#ifdef HAS_ILI9341
// Draw lines to show each menu button
for (int i = 0; i < 3; i++) {
// Draw horizontal line on left
display_obj.tft.drawLine(0,
TFT_HEIGHT / 3 * (i),
(TFT_WIDTH / 12) / 2,
TFT_HEIGHT / 3 * (i),
TFT_FARTGRAY);
// Draw horizontal line on left
display_obj.tft.drawLine(0,
TFT_HEIGHT / 3 * (i),
(TFT_WIDTH / 12) / 2,
TFT_HEIGHT / 3 * (i),
TFT_FARTGRAY);
// Draw horizontal line on right
display_obj.tft.drawLine(TFT_WIDTH - 1 - ((TFT_WIDTH / 12) / 2),
TFT_HEIGHT / 3 * (i),
TFT_WIDTH,
TFT_HEIGHT / 3 * (i),
TFT_FARTGRAY);
// Draw horizontal line on right
display_obj.tft.drawLine(TFT_WIDTH - 1 - ((TFT_WIDTH / 12) / 2),
TFT_HEIGHT / 3 * (i),
TFT_WIDTH,
TFT_HEIGHT / 3 * (i),
TFT_FARTGRAY);
// Draw vertical line on left
display_obj.tft.drawLine(0,
(TFT_HEIGHT / 3 * (i)) - ((TFT_WIDTH / 12) / 2),
0,
(TFT_HEIGHT / 3 * (i)) + ((TFT_WIDTH / 12) / 2),
TFT_FARTGRAY);
// Draw vertical line on left
display_obj.tft.drawLine(0,
(TFT_HEIGHT / 3 * (i)) - ((TFT_WIDTH / 12) / 2),
0,
(TFT_HEIGHT / 3 * (i)) + ((TFT_WIDTH / 12) / 2),
TFT_FARTGRAY);
// Draw vertical line on right
display_obj.tft.drawLine(TFT_WIDTH - 1,
(TFT_HEIGHT / 3 * (i)) - ((TFT_WIDTH / 12) / 2),
TFT_WIDTH - 1,
(TFT_HEIGHT / 3 * (i)) + ((TFT_WIDTH / 12) / 2),
TFT_FARTGRAY);
}
// Draw vertical line on right
display_obj.tft.drawLine(TFT_WIDTH - 1,
(TFT_HEIGHT / 3 * (i)) - ((TFT_WIDTH / 12) / 2),
TFT_WIDTH - 1,
(TFT_HEIGHT / 3 * (i)) + ((TFT_WIDTH / 12) / 2),
TFT_FARTGRAY);
}
#endif
}
// Function to check menu input