1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 12:17:12 +00:00

osc.lua: unify observe_property style

This commit is contained in:
nanahi 2024-06-03 22:03:50 -04:00 committed by Kacper Michajłow
parent 6337bc27ff
commit fa525265b4

View File

@ -2757,37 +2757,28 @@ mp.register_script_message("osc-tracklist", function(dur)
show_message(table.concat(message, '\n\n'), dur)
end)
mp.observe_property("fullscreen", "bool",
function(_, val)
state.fullscreen = val
state.marginsREQ = true
request_init_resize()
end
)
mp.observe_property("border", "bool",
function(_, val)
state.border = val
request_init_resize()
end
)
mp.observe_property("title-bar", "bool",
function(_, val)
state.title_bar = val
request_init_resize()
end
)
mp.observe_property("window-maximized", "bool",
function(_, val)
state.maximized = val
request_init_resize()
end
)
mp.observe_property("idle-active", "bool",
function(_, val)
state.idle = val
request_tick()
end
)
mp.observe_property("fullscreen", "bool", function(_, val)
state.fullscreen = val
state.marginsREQ = true
request_init_resize()
end)
mp.observe_property("border", "bool", function(_, val)
state.border = val
request_init_resize()
end)
mp.observe_property("title-bar", "bool", function(_, val)
state.title_bar = val
request_init_resize()
end)
mp.observe_property("window-maximized", "bool", function(_, val)
state.maximized = val
request_init_resize()
end)
mp.observe_property("idle-active", "bool", function(_, val)
state.idle = val
request_tick()
end)
mp.observe_property("pause", "bool", pause_state)
mp.observe_property("demuxer-cache-state", "native", cache_state)
mp.observe_property("vo-configured", "bool", request_tick)