Properly reload color UI on USB mass-storage

Resolves #79
This commit is contained in:
Raphael Coeffic
2021-05-25 08:32:59 +02:00
parent e7204a149a
commit 945fc9510a
2 changed files with 14 additions and 9 deletions
+13 -5
View File
@@ -1521,6 +1521,13 @@ void opentxClose(uint8_t shutdown)
RTOS_WAIT_MS(100);
#if defined(COLORLCD)
MainWindow::instance()->deleteChildren();
//TODO: In fact we want only to empty the trash (private method)
MainWindow::instance()->run();
#endif
#if defined(SDCARD)
sdDone();
#endif
@@ -1531,16 +1538,17 @@ void opentxResume()
{
TRACE("opentxResume");
#if !defined(LIBOPENUI)
menuHandlers[0] = menuMainView;
#endif
sdMount();
storageReadAll();
#if defined(COLORLCD)
#warning "TODO call loadTheme (not sure, it has been removed in some earlier commit)"
//TODO: needs to go into storageReadAll()
TRACE("reloading theme");
loadTheme();
// Force redraw
ViewMain::instance()->invalidate();
TRACE("theme reloaded & ViewMain invalidated");
#endif
// removed to avoid the double warnings (throttle, switch, etc.)