use layout() where appropriate and cleanup

This commit is contained in:
kepler155c@gmail.com
2020-04-09 16:08:54 -06:00
parent 8fe6e0806c
commit cd6ef0da50
14 changed files with 140 additions and 151 deletions

View File

@@ -13,8 +13,7 @@ function UI.Menu:postInit()
self.pageSize = #self.menuItems
end
function UI.Menu:setParent()
UI.Grid.setParent(self)
function UI.Menu:layout()
self.itemWidth = 1
for _,v in pairs(self.values) do
if #v.prompt > self.itemWidth then
@@ -28,6 +27,7 @@ function UI.Menu:setParent()
else
self.width = self.itemWidth + 2
end
UI.Grid.layout(self)
end
function UI.Menu:center()