mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-22 23:26:45 -08:00
Employ new drawButton function
This commit is contained in:
@@ -54,7 +54,7 @@ class Display
|
|||||||
TFT_eSPI tft = TFT_eSPI();
|
TFT_eSPI tft = TFT_eSPI();
|
||||||
TFT_eSprite img = TFT_eSprite(&tft);
|
TFT_eSprite img = TFT_eSprite(&tft);
|
||||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
||||||
String version_number = "v0.4.0";
|
String version_number = "v0.4.1";
|
||||||
|
|
||||||
bool printing = false;
|
bool printing = false;
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
|
|||||||
@@ -198,13 +198,15 @@ void MenuFunctions::main()
|
|||||||
for (uint8_t b = 0; b < current_menu->list->size(); b++) {
|
for (uint8_t b = 0; b < current_menu->list->size(); b++) {
|
||||||
display_obj.tft.setFreeFont(MENU_FONT);
|
display_obj.tft.setFreeFont(MENU_FONT);
|
||||||
if (display_obj.key[b].justPressed()) {
|
if (display_obj.key[b].justPressed()) {
|
||||||
display_obj.key[b].drawButton2(current_menu->list->get(b).name, true); // draw invert
|
//display_obj.key[b].drawButton2(current_menu->list->get(b).name, true); // draw invert
|
||||||
|
display_obj.key[b].drawButton(ML_DATUM, BUTTON_PADDING, current_menu->list->get(b).name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If button was just release, execute the button's function
|
// If button was just release, execute the button's function
|
||||||
if (display_obj.key[b].justReleased())
|
if (display_obj.key[b].justReleased())
|
||||||
{
|
{
|
||||||
display_obj.key[b].drawButton2(current_menu->list->get(b).name); // draw normal
|
//display_obj.key[b].drawButton2(current_menu->list->get(b).name); // draw normal
|
||||||
|
display_obj.key[b].drawButton(ML_DATUM, BUTTON_PADDING, current_menu->list->get(b).name);
|
||||||
current_menu->list->get(b).callable();
|
current_menu->list->get(b).callable();
|
||||||
}
|
}
|
||||||
display_obj.tft.setFreeFont(NULL);
|
display_obj.tft.setFreeFont(NULL);
|
||||||
@@ -413,7 +415,8 @@ void MenuFunctions::displayCurrentMenu()
|
|||||||
display_obj.tft.setFreeFont(MENU_FONT);
|
display_obj.tft.setFreeFont(MENU_FONT);
|
||||||
for (int i = 0; i < current_menu->list->size(); i++)
|
for (int i = 0; i < current_menu->list->size(); i++)
|
||||||
{
|
{
|
||||||
display_obj.key[i].drawButton2(current_menu->list->get(i).name);
|
//display_obj.key[i].drawButton2(current_menu->list->get(i).name);
|
||||||
|
display_obj.key[i].drawButton(ML_DATUM, BUTTON_PADDING, current_menu->list->get(i).name);
|
||||||
|
|
||||||
if (current_menu->list->get(i).name != "Back")
|
if (current_menu->list->get(i).name != "Back")
|
||||||
display_obj.tft.drawXBitmap(0,
|
display_obj.tft.drawXBitmap(0,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ extern Web web_obj;
|
|||||||
#define KEY_TEXTSIZE 1 // Font size multiplier
|
#define KEY_TEXTSIZE 1 // Font size multiplier
|
||||||
#define ICON_W 22
|
#define ICON_W 22
|
||||||
#define ICON_H 22
|
#define ICON_H 22
|
||||||
|
#define BUTTON_PADDING 22
|
||||||
//#define BUTTON_ARRAY_LEN 5
|
//#define BUTTON_ARRAY_LEN 5
|
||||||
|
|
||||||
#define FLASH_BUTTON 0
|
#define FLASH_BUTTON 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* FLASH SETTINGS
|
/* FLASH SETTINGS
|
||||||
Board: LOLIN D32
|
Board: LOLIN D32
|
||||||
Flash Frequency: 80MHz
|
Flash Frequency: 80MHz
|
||||||
Partition Scheme: No OTA
|
Partition Scheme: Minimal SPIFFS
|
||||||
https://www.online-utility.org/image/convert/to/XBM
|
https://www.online-utility.org/image/convert/to/XBM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user