From 7aab613ebaa885f5630ea40b9ba0a8229e0aa6f5 Mon Sep 17 00:00:00 2001 From: JustMe-NL Date: Sat, 6 Apr 2024 11:13:24 +0200 Subject: [PATCH] Update guiMemoryOptimizer.cpp Added 2 function to assist in updating widgets after new MQTT message recieved. --- .../gui/guiMemoryOptimizer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Platformio/src/applicationInternal/gui/guiMemoryOptimizer.cpp b/Platformio/src/applicationInternal/gui/guiMemoryOptimizer.cpp index 913a15a..34830df 100644 --- a/Platformio/src/applicationInternal/gui/guiMemoryOptimizer.cpp +++ b/Platformio/src/applicationInternal/gui/guiMemoryOptimizer.cpp @@ -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; +}