fix(color): widget background function called when one-time script is running (#7025)

This commit is contained in:
philmoz
2026-01-29 11:16:34 +10:00
committed by GitHub
parent 4db84e1663
commit 71305d502c
3 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -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;
+4 -2
View File
@@ -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();
}