mirror of
https://github.com/mpv-player/mpv
synced 2025-01-20 14:20:55 +00:00
osc.lua: fix user configurable colors
This commit is contained in:
parent
8dd262ffa5
commit
b6d7f778b8
@ -105,28 +105,32 @@ end
|
|||||||
|
|
||||||
-- luacheck: push ignore
|
-- luacheck: push ignore
|
||||||
-- luacheck: max line length
|
-- luacheck: max line length
|
||||||
local osc_styles = {
|
local osc_styles
|
||||||
bigButtons = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\3c&HFFFFFF\\fs50\\fnmpv-osd-symbols}",
|
|
||||||
smallButtonsL = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.small_buttonsL_color) .. "\\3c&HFFFFFF\\fs19\\fnmpv-osd-symbols}",
|
|
||||||
smallButtonsLlabel = "{\\fscx105\\fscy105\\fn" .. mp.get_property("options/osd-font") .. "}",
|
|
||||||
smallButtonsR = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.small_buttonsR_color) .. "\\3c&HFFFFFF\\fs30\\fnmpv-osd-symbols}",
|
|
||||||
topButtons = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.top_buttons_color) .. "\\3c&HFFFFFF\\fs12\\fnmpv-osd-symbols}",
|
|
||||||
|
|
||||||
elementDown = "{\\1c&H" .. osc_color_convert(user_opts.held_element_color) .."}",
|
local function set_osc_styles()
|
||||||
timecodes = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.timecode_color) .. "\\3c&HFFFFFF\\fs20}",
|
osc_styles = {
|
||||||
vidtitle = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\3c&HFFFFFF\\fs12\\q2}",
|
bigButtons = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\3c&HFFFFFF\\fs50\\fnmpv-osd-symbols}",
|
||||||
box = "{\\rDefault\\blur0\\bord1\\1c&H" .. osc_color_convert(user_opts.background_color) .. "\\3c&HFFFFFF}",
|
smallButtonsL = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.small_buttonsL_color) .. "\\3c&HFFFFFF\\fs19\\fnmpv-osd-symbols}",
|
||||||
|
smallButtonsLlabel = "{\\fscx105\\fscy105\\fn" .. mp.get_property("options/osd-font") .. "}",
|
||||||
|
smallButtonsR = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.small_buttonsR_color) .. "\\3c&HFFFFFF\\fs30\\fnmpv-osd-symbols}",
|
||||||
|
topButtons = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.top_buttons_color) .. "\\3c&HFFFFFF\\fs12\\fnmpv-osd-symbols}",
|
||||||
|
|
||||||
topButtonsBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.top_buttons_color) .. "\\3c&HFFFFFF\\fs18\\fnmpv-osd-symbols}",
|
elementDown = "{\\1c&H" .. osc_color_convert(user_opts.held_element_color) .."}",
|
||||||
smallButtonsBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\3c&HFFFFFF\\fs28\\fnmpv-osd-symbols}",
|
timecodes = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.timecode_color) .. "\\3c&HFFFFFF\\fs20}",
|
||||||
timecodesBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.timecode_color) .."\\3c&HFFFFFF\\fs27}",
|
vidtitle = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\3c&HFFFFFF\\fs12\\q2}",
|
||||||
timePosBar = "{\\blur0\\bord".. user_opts.tooltipborder .."\\1c&H" .. osc_color_convert(user_opts.time_pos_color) .. "\\3c&H" .. osc_color_convert(user_opts.time_pos_outline_color) .. "\\fs30}",
|
box = "{\\rDefault\\blur0\\bord1\\1c&H" .. osc_color_convert(user_opts.background_color) .. "\\3c&HFFFFFF}",
|
||||||
vidtitleBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\3c&HFFFFFF\\fs18\\q2}",
|
|
||||||
|
|
||||||
wcButtons = "{\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\fs24\\fnmpv-osd-symbols}",
|
topButtonsBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.top_buttons_color) .. "\\3c&HFFFFFF\\fs18\\fnmpv-osd-symbols}",
|
||||||
wcTitle = "{\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\fs24\\q2}",
|
smallButtonsBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\3c&HFFFFFF\\fs28\\fnmpv-osd-symbols}",
|
||||||
wcBar = "{\\1c&H" .. osc_color_convert(user_opts.background_color) .. "}",
|
timecodesBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.timecode_color) .."\\3c&HFFFFFF\\fs27}",
|
||||||
}
|
timePosBar = "{\\blur0\\bord".. user_opts.tooltipborder .."\\1c&H" .. osc_color_convert(user_opts.time_pos_color) .. "\\3c&H" .. osc_color_convert(user_opts.time_pos_outline_color) .. "\\fs30}",
|
||||||
|
vidtitleBar = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\3c&HFFFFFF\\fs18\\q2}",
|
||||||
|
|
||||||
|
wcButtons = "{\\1c&H" .. osc_color_convert(user_opts.buttons_color) .. "\\fs24\\fnmpv-osd-symbols}",
|
||||||
|
wcTitle = "{\\1c&H" .. osc_color_convert(user_opts.title_color) .. "\\fs24\\q2}",
|
||||||
|
wcBar = "{\\1c&H" .. osc_color_convert(user_opts.background_color) .. "}",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
-- internal states, do not touch
|
-- internal states, do not touch
|
||||||
local state = {
|
local state = {
|
||||||
@ -2970,6 +2974,7 @@ end
|
|||||||
-- read options from config and command-line
|
-- read options from config and command-line
|
||||||
opt.read_options(user_opts, "osc", function()
|
opt.read_options(user_opts, "osc", function()
|
||||||
validate_user_opts()
|
validate_user_opts()
|
||||||
|
set_osc_styles()
|
||||||
request_tick()
|
request_tick()
|
||||||
visibility_mode(user_opts.visibility, true)
|
visibility_mode(user_opts.visibility, true)
|
||||||
update_duration_watch()
|
update_duration_watch()
|
||||||
@ -2977,6 +2982,7 @@ opt.read_options(user_opts, "osc", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
validate_user_opts()
|
validate_user_opts()
|
||||||
|
set_osc_styles()
|
||||||
visibility_mode(user_opts.visibility, true)
|
visibility_mode(user_opts.visibility, true)
|
||||||
update_duration_watch()
|
update_duration_watch()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user