This commit is contained in:
Paul Liverman III
2018-04-06 15:30:00 -07:00
parent f0a9da387a
commit a45aa2624e
101 changed files with 12392 additions and 77 deletions

21
LIB/types/menu.moon Normal file
View File

@@ -0,0 +1,21 @@
path = (...)\sub 1, -("menu"\len! + 2)
generic = require "#{path}/generic"
import insert from table
class menu extends generic
new: (element={}, parent) =>
super element, parent
for child in *@
if @menu.width
child.width = @menu.width unless child.width
if @menu.height
child.height = @menu.height unless child.height
if @menu.align
child.align = @menu.align unless child.align
if #@menu > 0
slab = require "#{path\sub 1, -7}/slab"
for child in *@menu
insert(@, slab.make child, @)