osc.lua: make all the height of bar lines clickable

There is an area between the 2 lines of bottombar and topbar that is not
clickable, e.g. between the menu and play_pause icons. Make it all
clickable so it's easier to click buttons.

This also allows clicking from the bottom in slimbottombar and from the
top in topbottombar.
This commit is contained in:
Guido Cella authored and Kacper Michajłow committed 2026-04-08 20:32:48 +02:00
1 parent c9d2f17a98
commit 266cb79f38
1 file changed
+4 -5
+4 -5
View File
@@ -1719,7 +1719,6 @@ local function bar_layout(direction, slim)
}
local padX = 9
local padY = 3
local buttonW = 27
local tcW = (state.tc_ms) and 170 or 110
if user_opts.tcspace >= 50 and user_opts.tcspace <= 200 then
@@ -1761,8 +1760,8 @@ local function bar_layout(direction, slim)
osc_param.video_margins.t = osc_geo.h / osc_param.playresy
end
local line1 = osc_geo.y - direction * (9 + padY)
local line2 = osc_geo.y - direction * (36 + padY)
local line1 = osc_geo.y - direction * 12
local line2 = osc_geo.y - direction * 39
osc_param.areas = {}
@@ -1795,7 +1794,7 @@ local function bar_layout(direction, slim)
-- Menu
geo = { x = osc_geo.x + padX + 4, y = line1, an = 4, w = 18, h = 18 - padY }
geo = { x = osc_geo.x + padX + 4, y = line1, an = 4, w = 18, h = math.abs(line2 - line1) }
lo = add_layout("menu")
lo.geometry = geo
lo.style = osc_styles.topButtonsBar
@@ -1858,7 +1857,7 @@ local function bar_layout(direction, slim)
-- Playback control buttons
geo = { x = osc_geo.x + padX + padwc_l, y = line2, an = 4,
w = buttonW, h = 36 - padY*2}
w = buttonW, h = osc_geo.h - math.abs(line2 - line1)}
lo = add_layout("play_pause")
lo.geometry = geo
lo.style = osc_styles.smallButtonsBar