From 2a99e7ae128209bc22bfb7b6e6fab32cd3d31747 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Mon, 10 Oct 2016 22:53:33 +0100 Subject: osc: add user-alterable margin for top/bottombar --- DOCS/man/osc.rst | 4 ++++ player/lua/osc.lua | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 6f8048125f..2c66ede2d8 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -180,6 +180,10 @@ Configurable Options | Default: 0.0 | Horizontal alignment, -1 (left) to 1 (right) +``barmargin`` + | Default: 0 + | Margin from bottom (bottombar) or top (topbar), in pixels + ``boxalpha`` | Default: 80 | Alpha of the background box, 0 (opaque) to 255 (fully transparent) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 8b8ac9bd12..c82cace9f1 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -17,6 +17,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) + barmargin = 0, -- vertical margin of top/bottombar boxalpha = 80, -- alpha of the background box, -- 0 (opaque) to 255 (fully transparent) hidetimeout = 500, -- duration in ms until the OSC hides if no @@ -1042,7 +1043,7 @@ end layouts["bottombar"] = function() local osc_geo = { x = -2, - y = osc_param.playresy - 36, + y = osc_param.playresy - 36 - user_opts.barmargin, an = 7, w = osc_param.playresx + 4, h = 38, @@ -1061,7 +1062,7 @@ layouts["bottombar"] = function() local sh_area_y0, sh_area_y1 sh_area_y0 = get_align(-1 + (2*user_opts.deadzonesize), osc_geo.y - (osc_geo.h / 2), 0, 0) - sh_area_y1 = osc_param.playresy + sh_area_y1 = osc_param.playresy - user_opts.barmargin add_area("showhide", 0, sh_area_y0, osc_param.playresx, sh_area_y1) local lo, geo @@ -1177,7 +1178,7 @@ end layouts["topbar"] = function() local osc_geo = { x = -2, - y = 36, + y = 36 + user_opts.barmargin, an = 1, w = osc_param.playresx + 4, h = 38, @@ -1194,7 +1195,7 @@ layouts["topbar"] = function() osc_geo.w, osc_geo.h)) local sh_area_y0, sh_area_y1 - sh_area_y0 = 0 + sh_area_y0 = user_opts.barmargin sh_area_y1 = (osc_geo.y + (osc_geo.h / 2)) + get_align(1 - (2*user_opts.deadzonesize), osc_param.playresy - (osc_geo.y + (osc_geo.h / 2)), 0, 0) @@ -1264,7 +1265,7 @@ layouts["topbar"] = function() -- Seekbar - geo = { x = sb_l, y = 0, an = 7, w = math.max(0, sb_r - sb_l), h = geo.h } + geo = { x = sb_l, y = user_opts.barmargin, an = 7, w = math.max(0, sb_r - sb_l), h = geo.h } new_element("bgbar1", "box") lo = add_layout("bgbar1") -- cgit v1.2.3