add progress bar

This commit is contained in:
airstruck
2015-10-28 11:15:23 -04:00
parent 4372740363
commit 0759d36702
10 changed files with 44 additions and 5 deletions

15
luigi/widget/progress.lua Normal file
View File

@@ -0,0 +1,15 @@
return function (self)
self.value = 0.5
self.flow = 'x' -- TODO: support vertical slider
local bar = self:addChild {
type = 'progressInner',
width = 0,
}
self:onReshape(function (event)
local x1, y1, x2, y2 = self:getRectangle(true, true)
bar.width = self.value * (x2 - x1)
end)
end