chore(color): Cleanup and optimise EdgeTxTheme class (#4013)

This commit is contained in:
philmoz
2023-09-21 19:39:05 +10:00
committed by GitHub
parent 4d148e5c0c
commit 0aff002c8a
35 changed files with 309 additions and 677 deletions
+3 -7
View File
@@ -43,6 +43,7 @@
#include "radio_calibration.h"
#include "view_main.h"
#include "view_text.h"
#include "theme.h"
#include "gui/colorlcd/LvglWrapper.h"
#endif
@@ -322,11 +323,6 @@ void generalDefault()
strcpy(g_eeGeneral.currModelFilename, DEFAULT_MODEL_FILENAME);
#endif
#if defined(COLORLCD)
strcpy(g_eeGeneral.themeName, static_cast<EdgeTxTheme *>(theme)->getName());
static_cast<EdgeTxTheme *>(theme)->init();
#endif
#if defined(PXX2)
setDefaultOwnerId();
#endif
@@ -1171,7 +1167,7 @@ void opentxResume()
#if defined(COLORLCD)
//TODO: needs to go into storageReadAll()
TRACE("reloading theme");
loadTheme();
EdgeTxTheme::instance()->load();
// Force redraw
ViewMain::instance()->invalidate();
@@ -1534,7 +1530,7 @@ void opentxInit()
BACKLIGHT_ENABLE();
#if defined(COLORLCD)
loadTheme();
EdgeTxTheme::instance()->load();
if (g_eeGeneral.backlightMode == e_backlight_mode_off) {
// no backlight mode off on color lcd radios
g_eeGeneral.backlightMode = e_backlight_mode_keys;