History

osc.lua: add auto value to vidscale option

This adds auto to vidscale script option, which lets the scale be inherited from OSD --osd-scale-by-window option.

nanahi committed 2 years ago

Commit 0c741991 parent e61911c3 files · +14 −4Browse files

Unified · Split

3 files
  1. DOCS/interface-changes/osdscale.txt +1 −0
  2. DOCS/man/osc.rst +4 −2
  3. player/lua/osc.lua +9 −2
DOCS/interface-changes/osdscale.txt+1−0
@@ -0,0 +1 @@
1change `vidscale` script option type to string for osc.lua
DOCS/man/osc.rst+4−2
@@ -250,8 +250,10 @@ Configurable Options · 249 unmodified lines
250``vidscale``250``vidscale``
251 Default: yes251 Default: yes
252 252
253 Scale the OSC with the video253 Scale the OSC with the video.
254 ``no`` tries to keep the OSC size constant as much as the window size allows254 ``no`` tries to keep the OSC size constant as much as the window size allows.
255 ``auto`` scales the OSC with the OSD, which is scaled with the window or kept at a
256 constant size, depending on the ``--osd-scale-by-window`` option.
255 257
256``valign``258``valign``
257 Default: 0.8259 Default: 0.8
player/lua/osc.lua+9−2
@@ -14,7 +14,7 @@ local user_opts = { · 13 unmodified lines
14 idlescreen = true, -- show mpv logo on idle14 idlescreen = true, -- show mpv logo on idle
15 scalewindowed = 1, -- scaling of the controller when windowed15 scalewindowed = 1, -- scaling of the controller when windowed
16 scalefullscreen = 1, -- scaling of the controller when fullscreen16 scalefullscreen = 1, -- scaling of the controller when fullscreen
17 vidscale = true, -- scale the controller with the video?17 vidscale = "yes", -- scale the controller with the video?
18 valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom)18 valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom)
19 halign = 0, -- horizontal alignment, -1 (left) to 1 (right)19 halign = 0, -- horizontal alignment, -1 (left) to 1 (right)
20 barmargin = 0, -- vertical margin of top/bottombar20 barmargin = 0, -- vertical margin of top/bottombar
@@ -1785,7 +1785,14 @@ function osc_init() · 1764 unmodified lines
1785 scale = user_opts.scalewindowed1785 scale = user_opts.scalewindowed
1786 end1786 end
1787 1787
1788 if user_opts.vidscale then1788 local scale_with_video
1789 if user_opts.vidscale == "auto" then
1790 scale_with_video = mp.get_property_native("osd-scale-by-window")
1791 else
1792 scale_with_video = user_opts.vidscale == "yes"
1793 end
1794
1795 if scale_with_video then
1789 osc_param.unscaled_y = baseResY1796 osc_param.unscaled_y = baseResY
1790 else1797 else
1791 osc_param.unscaled_y = display_h1798 osc_param.unscaled_y = display_h

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t