Merge branch 'StickCPlus-2-port' into master

This commit is contained in:
Just Call Me Koko
2025-02-05 16:33:37 -05:00
committed by GitHub
12 changed files with 160 additions and 68 deletions
+14 -8
View File
@@ -574,7 +574,7 @@ void MenuFunctions::buttonNotSelected(uint8_t b, int8_t x) {
#ifdef HAS_FULL_SCREEN
display_obj.tft.setFreeFont(MENU_FONT);
display_obj.key[b].drawButton(false, current_menu->list->get(x).name);
if (current_menu->list->get(x).name != text09)
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
display_obj.tft.drawXBitmap(0,
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
menu_icons[current_menu->list->get(x).icon],
@@ -599,7 +599,7 @@ void MenuFunctions::buttonSelected(uint8_t b, int8_t x) {
#ifdef HAS_FULL_SCREEN
display_obj.tft.setFreeFont(MENU_FONT);
display_obj.key[b].drawButton(true, current_menu->list->get(x).name);
if (current_menu->list->get(x).name != text09)
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
display_obj.tft.drawXBitmap(0,
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
menu_icons[current_menu->list->get(x).icon],
@@ -1769,18 +1769,24 @@ void MenuFunctions::RunSetup()
});
// Select APs on Mini
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
this->addNodes(&wifiGeneralMenu, "Select APs", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
// Add the back button
wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu);
});
// Determine how big the whole menu is going to be
int menu_limit;
if (access_points->size() <= BUTTON_ARRAY_LEN)
menu_limit = access_points->size();
else
menu_limit = BUTTON_ARRAY_LEN;
// Populate the menu with buttons
for (int i = 0; i < menu_limit - 1; i++) {
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){
// This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, 255, [this, i](){
AccessPoint new_ap = access_points->get(i);
new_ap.selected = !access_points->get(i).selected;
@@ -2630,18 +2636,18 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index)
#ifdef HAS_FULL_SCREEN
#ifndef HAS_ILI9341
if ((current_menu->list->get(i).selected) || (current_menu->selected == i)) {
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
display_obj.key[i - start_index].drawButton(true, current_menu->list->get(i).name);
}
else {
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
display_obj.key[i - start_index].drawButton(false, current_menu->list->get(i).name);
}
#else
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
#endif
if (current_menu->list->get(i).name != text09)
if ((current_menu->list->get(i).name != text09) && (current_menu->list->get(i).icon != 255))
display_obj.tft.drawXBitmap(0,
KEY_Y + i * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
KEY_Y + (i - start_index) * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
menu_icons[current_menu->list->get(i).icon],
ICON_W,
ICON_H,