diff options
| -rw-r--r-- | config.lua | 1 | ||||
| -rw-r--r-- | osd.lua | 2 | ||||
| -rw-r--r-- | rx.lua | 21 |
3 files changed, 17 insertions, 7 deletions
@@ -20,6 +20,7 @@ config.bg_hover_alpha = '66' config.colour = { title = '999999', option = 'ffffff', + option_dim = '999999', info = '666666', group = 'ffdd99', group_empty = '776644', @@ -226,7 +226,7 @@ end function mt:option_text(opt, info) local str = opt.name - local col = colour.option + local col = opt.ended and colour.option_dim or colour.option if info.selected then col = info.empty and colour.selected_empty or colour.selected elseif info.empty then @@ -240,19 +240,28 @@ end local programme_mt = { __index = function(t, k) - if k == 'active' then + if k == 'active' or k == 'ended' then local time = osd.redraw_time if t._exp and time < t._exp then - return t._active + if k == 'active' then + return t._active + end + return t._ended end local v = t.programme - local ret = time >= v.start and time < v.stop + local ended = time >= v.stop + local active = not ended and time >= v.start local exp = time < v.start and v.start or - ret and v.stop or nil - rawset(t, exp and '_active' or 'active', ret) + active and v.stop or nil + rawset(t, exp and '_active' or 'active', active) + rawset(t, exp and '_ended' or 'ended', ended) rawset(t, '_exp', exp) - return ret + + if k == 'active' then + return active + end + return ended end end, } |
