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();
|
auto start = timersGetMsTick();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ViewMain::refreshWidgets();
|
if (widgetRefreshEnable)
|
||||||
|
ViewMain::refreshWidgets();
|
||||||
|
|
||||||
auto opaque = Window::firstOpaque();
|
auto opaque = Window::firstOpaque();
|
||||||
if (opaque) {
|
if (opaque) {
|
||||||
|
|||||||
@@ -51,9 +51,12 @@ class MainWindow: public Window
|
|||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
void enableWidgetRefresh(bool state) { widgetRefreshEnable = state; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
lv_obj_t* background = nullptr;
|
lv_obj_t* background = nullptr;
|
||||||
const BitmapBuffer *backgroundBitmap = nullptr;
|
const BitmapBuffer *backgroundBitmap = nullptr;
|
||||||
|
bool widgetRefreshEnable = true;
|
||||||
|
|
||||||
static MainWindow * _instance;
|
static MainWindow * _instance;
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ StandaloneLuaWindow::StandaloneLuaWindow(bool useLvgl, int initFn, int runFn) :
|
|||||||
|
|
||||||
pushLayer(true);
|
pushLayer(true);
|
||||||
|
|
||||||
|
MainWindow::instance()->enableWidgetRefresh(false);
|
||||||
|
|
||||||
if (useLvglLayout()) {
|
if (useLvglLayout()) {
|
||||||
padAll(PAD_ZERO);
|
padAll(PAD_ZERO);
|
||||||
etx_scrollbar(lvobj);
|
etx_scrollbar(lvobj);
|
||||||
@@ -205,8 +207,6 @@ void StandaloneLuaWindow::deleteLater()
|
|||||||
|
|
||||||
luaScriptManager = nullptr;
|
luaScriptManager = nullptr;
|
||||||
|
|
||||||
Window::deleteLater();
|
|
||||||
|
|
||||||
_instance = nullptr;
|
_instance = nullptr;
|
||||||
|
|
||||||
#if defined(USE_HATS_AS_KEYS)
|
#if defined(USE_HATS_AS_KEYS)
|
||||||
@@ -217,6 +217,8 @@ void StandaloneLuaWindow::deleteLater()
|
|||||||
|
|
||||||
luaEmptyEventBuffer();
|
luaEmptyEventBuffer();
|
||||||
|
|
||||||
|
MainWindow::instance()->enableWidgetRefresh(true);
|
||||||
|
|
||||||
Window::deleteLater();
|
Window::deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user