tweaks + Anavrins disk usage system module
This commit is contained in:
@@ -6,13 +6,23 @@ local colors = _G.colors
|
||||
UI.ProgressBar = class(UI.Window)
|
||||
UI.ProgressBar.defaults = {
|
||||
UIElement = 'ProgressBar',
|
||||
progressColor = colors.lime,
|
||||
backgroundColor = colors.gray,
|
||||
height = 1,
|
||||
progressColor = colors.lime,
|
||||
progressChar = UI.extChars and '\153' or ' ',
|
||||
fillChar = ' ',
|
||||
fillColor = colors.gray,
|
||||
textColor = colors.green,
|
||||
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)
|
||||
|
||||
local filler = string.rep(self.fillChar, self.width)
|
||||
local progress = string.rep(self.progressChar, width)
|
||||
|
||||
for i = 1, self.height do
|
||||
self:write(1, i, filler, nil, self.fillColor)
|
||||
self:write(1, i, progress, self.progressColor)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user