fix(lua): Store and update the 'zone' rectangle for Lua widgets. (#3060)
* Store 'zone' rectangle dat in Lua registry and update it when the screen layout changes or full screen mode changes. Allows Lua widgets to adjust to layout changes. * Call widget 'update' function is layout has changed.
This commit is contained in:
@@ -60,6 +60,7 @@ class LuaWidget : public Widget, public LuaEventHandler
|
||||
friend class LuaWidgetFactory;
|
||||
|
||||
int luaWidgetDataRef;
|
||||
int zoneRectDataRef;
|
||||
char* errorMessage;
|
||||
bool refreshed = false;
|
||||
|
||||
@@ -73,9 +74,13 @@ class LuaWidget : public Widget, public LuaEventHandler
|
||||
|
||||
void setErrorMessage(const char* funcName);
|
||||
|
||||
// Update 'zone' data
|
||||
void updateZoneRect(rect_t rect) override;
|
||||
bool updateTable(const char* idx, int val);
|
||||
|
||||
public:
|
||||
LuaWidget(const WidgetFactory* factory, Window* parent, const rect_t& rect,
|
||||
WidgetPersistentData* persistentData, int luaWidgetDataRef);
|
||||
WidgetPersistentData* persistentData, int luaWidgetDataRef, int zoneRectDataRef);
|
||||
~LuaWidget() override;
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
|
||||
Reference in New Issue
Block a user