feat: dynamic volume icon (#699)
This commit is contained in:
@@ -261,7 +261,11 @@ function Volume:render()
|
|||||||
cursor.on_primary_down = function() mp.commandv('cycle', 'mute') end
|
cursor.on_primary_down = function() mp.commandv('cycle', 'mute') end
|
||||||
end
|
end
|
||||||
local ass = assdraw.ass_new()
|
local ass = assdraw.ass_new()
|
||||||
local icon_name = state.mute and 'volume_off' or 'volume_up'
|
local icon_name = 'volume_up'
|
||||||
|
if state.mute then icon_name = 'volume_off'
|
||||||
|
elseif state.volume <= 0 then icon_name = 'volume_mute'
|
||||||
|
elseif state.volume <= 60 then icon_name = 'volume_down'
|
||||||
|
end
|
||||||
local width_half = (mute_rect.bx - mute_rect.ax) / 2
|
local width_half = (mute_rect.bx - mute_rect.ax) / 2
|
||||||
local height_half = (mute_rect.by - mute_rect.ay) / 2
|
local height_half = (mute_rect.by - mute_rect.ay) / 2
|
||||||
local icon_size = math.min(width_half, height_half) * 1.5
|
local icon_size = math.min(width_half, height_half) * 1.5
|
||||||
|
Reference in New Issue
Block a user