Tweak volume value position and rendering

This commit is contained in:
Tomas Sardyha
2020-04-12 12:36:09 +02:00
parent 91cb0be42b
commit 0a679b0fb6

View File

@@ -1486,18 +1486,22 @@ function render_volume(this)
ass:draw_stop()
-- Current volume value
ass:new_event()
ass:append('{\\blur0\\bord0\\shad0\\1c&H'..options.color_foreground_text..'\\fn'..config.font..'\\fs'..slider.font_size..'\\clip('..fpath.scale..', '..fpath.text..')')
ass:append(ass_opacity(math.min(options.volume_opacity + 0.1, 1), opacity))
ass:pos(slider.ax + (slider.width / 2), bay + slider.spacing)
ass:an(8)
ass:append(state.volume)
ass:new_event()
ass:append('{\\blur0\\bord0\\shad1\\1c&H'..options.color_background_text..'\\4c&H'..options.color_background..'\\fn'..config.font..'\\fs'..slider.font_size..'\\iclip('..fpath.scale..', '..fpath.text..')')
ass:append(ass_opacity(math.min(options.volume_opacity + 0.1, 1), opacity))
ass:pos(slider.ax + (slider.width / 2), bay + slider.spacing)
ass:an(8)
ass:append(state.volume)
if fay < slider.by - slider.spacing then
ass:new_event()
ass:append('{\\blur0\\bord0\\shad0\\1c&H'..options.color_foreground_text..'\\fn'..config.font..'\\fs'..slider.font_size..'\\clip('..fpath.scale..', '..fpath.text..')')
ass:append(ass_opacity(math.min(options.volume_opacity + 0.1, 1), opacity))
ass:pos(slider.ax + (slider.width / 2), slider.by - slider.spacing)
ass:an(2)
ass:append(state.volume)
end
if fay > slider.by - slider.spacing - slider.font_size then
ass:new_event()
ass:append('{\\blur0\\bord0\\shad1\\1c&H'..options.color_background_text..'\\4c&H'..options.color_background..'\\fn'..config.font..'\\fs'..slider.font_size..'\\iclip('..fpath.scale..', '..fpath.text..')')
ass:append(ass_opacity(math.min(options.volume_opacity + 0.1, 1), opacity))
ass:pos(slider.ax + (slider.width / 2), slider.by - slider.spacing)
ass:an(2)
ass:append(state.volume)
end
-- Mute button
local mute = elements.volume_mute