Update guiMemoryOptimizer.cpp

Added 2 function to assist in updating widgets after new MQTT message recieved.
This commit is contained in:
JustMe-NL 2024-04-06 11:13:24 +02:00 committed by GitHub
parent 9669d15c3c
commit 7aab613eba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -491,3 +491,18 @@ void gui_memoryOptimizer_doAfterSliding_deletionAndCreation(lv_obj_t** tabview,
Serial.printf("------------ End of tab deletion and creation\r\n");
}
bool checkTabActive(std::string tabName) {
bool tabnameIsActive = false;
if ((tabs_in_memory[1].guiName == tabName) && (tabs_in_memory[2].listIndex > 0)) tabnameIsActive = true;
if ((tabs_in_memory[0].guiName == tabName) && (tabs_in_memory[2].listIndex < 0)) tabnameIsActive = true;
return tabnameIsActive;
}
bool checkTabinMemory(std::string tabName) {
bool tabnameIsActive = false;
for (uint8_t i = 0; i < 3; i++) {
if (tabs_in_memory[i].guiName == tabName) tabnameIsActive = true;
}
return tabnameIsActive;
}