1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-26 07:03:21 +00:00
opus/sys/modules/opus/ui/components/ProgressBar.lua
2019-06-28 13:50:02 -04:00

19 lines
442 B
Lua

local class = require('opus.class')
local UI = require('opus.ui')
local colors = _G.colors
UI.ProgressBar = class(UI.Window)
UI.ProgressBar.defaults = {
UIElement = 'ProgressBar',
progressColor = colors.lime,
backgroundColor = colors.gray,
height = 1,
value = 0,
}
function UI.ProgressBar:draw()
self:clear()
local width = math.ceil(self.value / 100 * self.width)
self:clearArea(1, 1, width, self.height, self.progressColor)
end