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
+1 -4
View File
@@ -22,11 +22,7 @@
#include "menu_model.h"
#include "menu_radio.h"
#include "menu_screen.h"
//#include "model_select.h"
//#include "view_channels.h"
//#include "view_statistics.h"
#include "topbar_impl.h"
//#include "menu.h"
#include "view_main_menu.h"
#include "opentx.h"
@@ -48,6 +44,7 @@ ViewMain::ViewMain():
ViewMain::~ViewMain()
{
_instance = nullptr;
}
void ViewMain::setTopbarVisible(float visible)
+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.)