diff options
author | wm4 <wm4@nowhere> | 2019-12-20 13:21:49 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-12-20 13:21:49 +0100 |
commit | 70c540195245948978077ecb8316e2dca6807042 (patch) | |
tree | 43d83c1e9f0eb43092c4b71e649f5b48efbe7435 /player/lua | |
parent | 7338e3d8fe094c1f06d56f05a54f252bfb2b80d9 (diff) | |
download | mpv-70c540195245948978077ecb8316e2dca6807042.tar.bz2 mpv-70c540195245948978077ecb8316e2dca6807042.tar.xz |
osc: move windowcontrols option code to the right place
There doesn't seem to be a reason why it was where it was. It should be
in validate_user_opts(), which will be important for runtime changing
too.
Diffstat (limited to 'player/lua')
-rw-r--r-- | player/lua/osc.lua | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 262e679891..e06e1ef8ef 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -59,21 +59,6 @@ if user_opts.hidetimeout < 0 then msg.warn("hidetimeout cannot be negative. Using " .. user_opts.hidetimeout) end --- validate window control options -if user_opts.windowcontrols ~= "auto" and - user_opts.windowcontrols ~= "yes" and - user_opts.windowcontrols ~= "no" then - msg.warn("windowcontrols cannot be \"" .. - user_opts.windowcontrols .. "\". Ignoring.") - user_opts.windowcontrols = "auto" -end -if user_opts.windowcontrols_alignment ~= "right" and - user_opts.windowcontrols_alignment ~= "left" then - msg.warn("windowcontrols_alignment cannot be \"" .. - user_opts.windowcontrols_alignment .. "\". Ignoring.") - user_opts.windowcontrols_alignment = "right" -end - local osc_param = { -- calculated by osc_init() playresy = 0, -- canvas size Y playresx = 0, -- canvas size X @@ -1645,6 +1630,20 @@ function validate_user_opts() msg.warn("Using \"slider\" seekrangestyle together with \"bar\" seekbarstyle is not supported") user_opts.seekrangestyle = "inverted" end + + if user_opts.windowcontrols ~= "auto" and + user_opts.windowcontrols ~= "yes" and + user_opts.windowcontrols ~= "no" then + msg.warn("windowcontrols cannot be \"" .. + user_opts.windowcontrols .. "\". Ignoring.") + user_opts.windowcontrols = "auto" + end + if user_opts.windowcontrols_alignment ~= "right" and + user_opts.windowcontrols_alignment ~= "left" then + msg.warn("windowcontrols_alignment cannot be \"" .. + user_opts.windowcontrols_alignment .. "\". Ignoring.") + user_opts.windowcontrols_alignment = "right" + end end |