fix: resize pages after re-parenting to monitor device

Page:postInit defaults parent to UI.term (small computer terminal).
Window:postInit then calls setParent() which computes all child
dimensions from that small terminal. When we later re-parent to
the monitor device, the children retain their small dimensions.
Adding resize() before setParent() forces all children to
recompute dimensions from the correct monitor size.
This commit is contained in:
MayaTheShy
2026-03-22 19:09:49 -04:00
parent 5518161adf
commit d4a9441b54

View File

@@ -446,9 +446,11 @@ local function buildMainPage()
btnX = btnX + #tostring(amt) + 4
end
-- Attach to device
-- Attach to device (must resize to recompute all child dimensions
-- from the monitor device, since Page:postInit defaulted to UI.term)
mainDevice.currentPage = mainPage
mainPage.parent = mainDevice
mainPage:resize()
mainPage:setParent()
mainPage:enable()
end
@@ -886,6 +888,7 @@ local function buildSmelterPage()
-- Attach to device
smelterDevice.currentPage = smelterPage
smelterPage.parent = smelterDevice
smelterPage:resize()
smelterPage:setParent()
smelterPage:enable()
end