fix(color): widget background function called when one-time script is running (#7025)
This commit is contained in:
@@ -64,7 +64,8 @@ void MainWindow::run()
|
||||
auto start = timersGetMsTick();
|
||||
#endif
|
||||
|
||||
ViewMain::refreshWidgets();
|
||||
if (widgetRefreshEnable)
|
||||
ViewMain::refreshWidgets();
|
||||
|
||||
auto opaque = Window::firstOpaque();
|
||||
if (opaque) {
|
||||
|
||||
@@ -51,9 +51,12 @@ class MainWindow: public Window
|
||||
|
||||
void shutdown();
|
||||
|
||||
void enableWidgetRefresh(bool state) { widgetRefreshEnable = state; }
|
||||
|
||||
protected:
|
||||
lv_obj_t* background = nullptr;
|
||||
const BitmapBuffer *backgroundBitmap = nullptr;
|
||||
bool widgetRefreshEnable = true;
|
||||
|
||||
static MainWindow * _instance;
|
||||
|
||||
|
||||
@@ -136,6 +136,8 @@ StandaloneLuaWindow::StandaloneLuaWindow(bool useLvgl, int initFn, int runFn) :
|
||||
|
||||
pushLayer(true);
|
||||
|
||||
MainWindow::instance()->enableWidgetRefresh(false);
|
||||
|
||||
if (useLvglLayout()) {
|
||||
padAll(PAD_ZERO);
|
||||
etx_scrollbar(lvobj);
|
||||
@@ -205,8 +207,6 @@ void StandaloneLuaWindow::deleteLater()
|
||||
|
||||
luaScriptManager = nullptr;
|
||||
|
||||
Window::deleteLater();
|
||||
|
||||
_instance = nullptr;
|
||||
|
||||
#if defined(USE_HATS_AS_KEYS)
|
||||
@@ -217,6 +217,8 @@ void StandaloneLuaWindow::deleteLater()
|
||||
|
||||
luaEmptyEventBuffer();
|
||||
|
||||
MainWindow::instance()->enableWidgetRefresh(true);
|
||||
|
||||
Window::deleteLater();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user