From 64613d943ba8288dc78c178c5cb67dd132bf4380 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Fri, 4 Oct 2024 00:55:12 +0200 Subject: [PATCH] Properly delegate sub-windows on container element reload --- gfx/list.lua | 8 -------- gfx/padding.lua | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gfx/list.lua b/gfx/list.lua index 39acdb6..00dc096 100644 --- a/gfx/list.lua +++ b/gfx/list.lua @@ -29,14 +29,6 @@ function List:insertChild(child, atIndex) adjustPositions(self.children, self:isVertical(), index) end -function List:setParent(parent) - Element.setParent(self, parent) - local win = self:_getWindow() - for _,child in ipairs(self.children) do - child:setParent(win) - end -end - function List:removeChild(child) local index local searchType = type(child) diff --git a/gfx/padding.lua b/gfx/padding.lua index ebb26f6..a3de557 100644 --- a/gfx/padding.lua +++ b/gfx/padding.lua @@ -88,4 +88,9 @@ function Padding:handleEvent(evt) return false end +function Padding:_reload() + Element._reload(self) + self.element:setParent(self:_getWindow()) +end + return Padding \ No newline at end of file