1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 21:31:52 +00:00

osc: add volume icons to osd font and use them

Glyphs taken and based on U+1F507 to U+1F50A from Symbola, which
is available under public domain: http://users.teilar.gr/~g1951d/
This commit is contained in:
Ricardo Constantino 2017-04-18 00:13:35 +01:00
parent a047e636ab
commit 05c8707a0b
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
2 changed files with 4 additions and 3 deletions

View File

@ -1837,11 +1837,12 @@ function osc_init()
ne.content = function()
local volume = mp.get_property_number("volume", 0)
local mute = mp.get_property_native("mute")
local volicon = {"🔈", "🔉", "🔊"}
local volicon = {"\238\132\139", "\238\132\140",
"\238\132\141", "\238\132\142"}
if volume == 0 or mute then
return "🔇"
return "\238\132\138"
else
return volicon[math.min(3,math.ceil(volume / (100/3)))]
return volicon[math.min(4,math.ceil(volume / (100/3)))]
end
end
ne.eventresponder["mouse_btn0_up"] =

Binary file not shown.