mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Menu buttons delineated by brackets
This commit is contained in:
@@ -653,6 +653,40 @@ void MenuFunctions::buttonSelected(int b, int x) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void MenuFunctions::displayMenuButtons() {
|
||||
// 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 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 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);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to check menu input
|
||||
void MenuFunctions::main(uint32_t currentTime)
|
||||
{
|
||||
@@ -978,13 +1012,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
current_menu->list->get(current_menu->selected).callable();
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
display_obj.tft.drawLine(0,
|
||||
TFT_HEIGHT / 3 * (i),
|
||||
TFT_WIDTH,
|
||||
TFT_HEIGHT / 3 * (i),
|
||||
TFT_FARTGRAY);
|
||||
}
|
||||
if (wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF)
|
||||
this->displayMenuButtons();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3104,13 +3133,7 @@ void MenuFunctions::displayCurrentMenu(int start_index)
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
display_obj.tft.drawLine(0,
|
||||
TFT_HEIGHT / 3 * (i),
|
||||
TFT_WIDTH,
|
||||
TFT_HEIGHT / 3 * (i),
|
||||
TFT_FARTGRAY);
|
||||
}
|
||||
this->displayMenuButtons();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -193,6 +193,7 @@ class MenuFunctions
|
||||
|
||||
// Menu icons
|
||||
|
||||
void displayMenuButtons();
|
||||
uint16_t getColor(uint16_t color);
|
||||
void drawAvgLine(int16_t value);
|
||||
void drawMaxLine(int16_t value, uint16_t color);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//#define MARAUDER_CYD_GUITION // ESP32-2432S024 GUITION
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.4.6"
|
||||
#define MARAUDER_VERSION "v1.5.0"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user