mirror of
https://github.com/kepler155c/opus
synced 2025-12-20 07:08:06 +00:00
ui overhaul
This commit is contained in:
18
sys/apis/ui/components/ProgressBar.lua
Normal file
18
sys/apis/ui/components/ProgressBar.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local class = require('class')
|
||||
local UI = require('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
|
||||
Reference in New Issue
Block a user