bugfix to hbar
This commit is contained in:
parent
7f007e032d
commit
ea9e9288f7
@ -27,12 +27,15 @@ local function hbar(args)
|
|||||||
-- bar width is width - 5 characters for " 100%" if showing percent
|
-- bar width is width - 5 characters for " 100%" if showing percent
|
||||||
local bar_width = util.trinary(args.show_percent, e.frame.w - 5, e.frame.w)
|
local bar_width = util.trinary(args.show_percent, e.frame.w - 5, e.frame.w)
|
||||||
|
|
||||||
assert(bar_width > 0, "graphics.elements.hbar: too small for bar")
|
assert(bar_width > 0, "graphics.elements.indicators.hbar: too small for bar")
|
||||||
|
|
||||||
-- determine bar colors
|
-- determine bar colors
|
||||||
---@fixme this doesnt work as intended
|
local bar_bkg = e.fg_bg.blit_bkg
|
||||||
local bar_bkg = util.trinary(args.bar_fg_bg == nil, e.fg_bg.blit_bkg, args.bar_fg_bg.blit_bkg)
|
local bar_fgd = e.fg_bg.blit_fgd
|
||||||
local bar_fgd = util.trinary(args.bar_fg_bg == nil, e.fg_bg.blit_fgd, args.bar_fg_bg.blit_fgd)
|
if args.show_percent and args.bar_fg_bg ~= nil then
|
||||||
|
bar_bkg = args.bar_fg_bg.blit_bkg
|
||||||
|
bar_fgd = args.bar_fg_bg.blit_fgd
|
||||||
|
end
|
||||||
|
|
||||||
-- handle data changes
|
-- handle data changes
|
||||||
function e.on_update(fraction)
|
function e.on_update(fraction)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user