standalone LUA: do not really "attach" the window to any parent
It is on a separate screen anyway.
This commit is contained in:
committed by
Raphael Coeffic
parent
0f07f2b690
commit
d9c1af2080
@@ -175,7 +175,7 @@ class SelectTemplate : public TemplatePage
|
|||||||
// Need to update() the ModelCategoryPageBody before attaching StandaloneLuaWindow to not mess up focus
|
// Need to update() the ModelCategoryPageBody before attaching StandaloneLuaWindow to not mess up focus
|
||||||
update();
|
update();
|
||||||
update = nullptr;
|
update = nullptr;
|
||||||
StandaloneLuaWindow::instance()->attach(focusWindow);
|
StandaloneLuaWindow::instance()->attach();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ static void run_lua_tool(Window* parent, const std::string& path)
|
|||||||
|
|
||||||
luaExec(path.c_str());
|
luaExec(path.c_str());
|
||||||
auto lua_win = StandaloneLuaWindow::instance();
|
auto lua_win = StandaloneLuaWindow::instance();
|
||||||
lua_win->attach(parent);
|
lua_win->attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
// LUA scripts in TOOLS
|
// LUA scripts in TOOLS
|
||||||
|
|||||||
@@ -71,15 +71,13 @@ StandaloneLuaWindow* StandaloneLuaWindow::instance()
|
|||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StandaloneLuaWindow::attach(Window* newParent)
|
void StandaloneLuaWindow::attach()
|
||||||
{
|
{
|
||||||
if (!prevScreen) {
|
if (!prevScreen) {
|
||||||
|
|
||||||
// backup previous screen
|
// backup previous screen
|
||||||
prevScreen = lv_scr_act();
|
prevScreen = lv_scr_act();
|
||||||
|
|
||||||
Window::attach(newParent->getFullScreenWindow());
|
|
||||||
|
|
||||||
// and load new one
|
// and load new one
|
||||||
lv_scr_load(lvobj);
|
lv_scr_load(lvobj);
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class StandaloneLuaWindow : public Window
|
|||||||
public:
|
public:
|
||||||
static StandaloneLuaWindow* instance();
|
static StandaloneLuaWindow* instance();
|
||||||
|
|
||||||
void attach(Window* newParent);
|
void attach();
|
||||||
void deleteLater(bool detach = true, bool trash = true) override;
|
void deleteLater(bool detach = true, bool trash = true) override;
|
||||||
void paint(BitmapBuffer* dc) override;
|
void paint(BitmapBuffer* dc) override;
|
||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
|
|||||||
Reference in New Issue
Block a user