mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 10:26:43 +00:00
add progress bar
This commit is contained in:
15
luigi/widget/progress.lua
Normal file
15
luigi/widget/progress.lua
Normal 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
|
||||
Reference in New Issue
Block a user