context menus working

This commit is contained in:
airstruck
2015-12-24 09:42:04 -05:00
parent 2d0dec2c70
commit 3abcce1615
9 changed files with 148 additions and 61 deletions

View File

@@ -43,15 +43,24 @@ Contains the index in `items` of the item being displayed.
self.index = 1
self.flow = 'x' -- TODO: support vertical stepper
local contextMenu
for index, child in ipairs(self) do
child.type = child.type or 'stepper.item'
self.items[index] = child
if child.isContextMenu then
contextMenu = child
else
self.items[index] = child
end
self[index] = nil
end
local before = self:addChild { type = 'stepper.before' }
local view = self:addChild { type = 'stepper.view' }
local after = self:addChild { type = 'stepper.after' }
if contextMenu then
self:addChild(contextMenu)
end
self:onReshape(function (event)
if self.flow == 'x' then