add Layout:placeNear convenience method

This commit is contained in:
airstruck
2016-01-19 14:36:25 -05:00
parent 78e02c190e
commit 93da8dedfa
2 changed files with 28 additions and 25 deletions

View File

@@ -50,14 +50,13 @@ local function addLayoutChildren (self)
end
end
local isSubmenu = self.parentMenu and self.parentMenu.parentMenu
local x = isSubmenu and self:getWidth() or 0
local y = isSubmenu and 0 or self:getHeight()
root.left = self:getX() + x
root.top = self:getY() + y
root.height = height
root.width = textWidth + keyWidth + (root.padding or 0)
local isSubmenu = self.parentMenu and self.parentMenu.parentMenu
local w = isSubmenu and self:getWidth() or 0
local h = isSubmenu and 0 or self:getHeight()
self.menuLayout:placeNear(self:getX(), self:getY(), w, h)
end
local function show (self)