From 6e34322decea755fe5e6efebabf9d93c473558b6 Mon Sep 17 00:00:00 2001 From: ChrisK2 Date: Fri, 18 Oct 2013 00:32:07 +0200 Subject: osc: make transparency of background-box configurable see boxalpha option --- DOCS/man/en/osc.rst | 6 +++++- mpvcore/lua/osc.lua | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DOCS/man/en/osc.rst b/DOCS/man/en/osc.rst index 9a3dc92177..299a6a95e8 100644 --- a/DOCS/man/en/osc.rst +++ b/DOCS/man/en/osc.rst @@ -6,7 +6,7 @@ offer basic mouse-controllability. It is intended to make interaction easier for new users and to enable precise and direct seeking. The OSC is enabled by default if mpv was compiled with lua support. It can be -disabled using ``--osc=no``. +disabled entirely using the ``--osc=no`` option. Using the OSC ------------- @@ -176,6 +176,10 @@ Configurable parameters | Default: 0 | Horizontal alignment, -1 (left) to 1 (right) +``boxalpha`` + | Default: 80 + | Alpha of the background box, 0 (opaque) to 255 (fully transparent) + ``hidetimeout`` | Default: 500 | Duration in ms until the OSC hides if no mouse movement, negative value diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua index c724c7737c..8166cd6896 100644 --- a/mpvcore/lua/osc.lua +++ b/mpvcore/lua/osc.lua @@ -18,6 +18,7 @@ local user_opts = { vidscale = true, -- scale the controller with the video? valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom) halign = 0, -- horizontal alignment, -1 (left) to 1 (right) + boxalpha = 80, -- alpha of the background box, 0 (opaque) to 255 (fully transparent) hidetimeout = 500, -- duration in ms until the OSC hides if no mouse movement, negative value disables autohide fadeduration = 200, -- duration of fade out in ms, 0 = no fade deadzonesize = 0, -- size of deadzone @@ -675,8 +676,8 @@ function osc_init() -- local metainfo = {} - metainfo.alpha1 = 80 - metainfo.alpha3 = 80 + metainfo.alpha1 = user_opts.boxalpha + metainfo.alpha3 = user_opts.boxalpha register_box(posX, posY, 5, osc_w, osc_h, osc_r, osc_styles.box, metainfo) -- -- cgit v1.2.3