Skip to content

Commit 266cb79

Browse files
guidocellakasper93
authored andcommitted
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.
1 parent c9d2f17 commit 266cb79

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

player/lua/osc.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,6 @@ local function bar_layout(direction, slim)
17191719
}
17201720

17211721
local padX = 9
1722-
local padY = 3
17231722
local buttonW = 27
17241723
local tcW = (state.tc_ms) and 170 or 110
17251724
if user_opts.tcspace >= 50 and user_opts.tcspace <= 200 then
@@ -1761,8 +1760,8 @@ local function bar_layout(direction, slim)
17611760
osc_param.video_margins.t = osc_geo.h / osc_param.playresy
17621761
end
17631762

1764-
local line1 = osc_geo.y - direction * (9 + padY)
1765-
local line2 = osc_geo.y - direction * (36 + padY)
1763+
local line1 = osc_geo.y - direction * 12
1764+
local line2 = osc_geo.y - direction * 39
17661765

17671766
osc_param.areas = {}
17681767

@@ -1795,7 +1794,7 @@ local function bar_layout(direction, slim)
17951794

17961795

17971796
-- Menu
1798-
geo = { x = osc_geo.x + padX + 4, y = line1, an = 4, w = 18, h = 18 - padY }
1797+
geo = { x = osc_geo.x + padX + 4, y = line1, an = 4, w = 18, h = math.abs(line2 - line1) }
17991798
lo = add_layout("menu")
18001799
lo.geometry = geo
18011800
lo.style = osc_styles.topButtonsBar
@@ -1858,7 +1857,7 @@ local function bar_layout(direction, slim)
18581857

18591858
-- Playback control buttons
18601859
geo = { x = osc_geo.x + padX + padwc_l, y = line2, an = 4,
1861-
w = buttonW, h = 36 - padY*2}
1860+
w = buttonW, h = osc_geo.h - math.abs(line2 - line1)}
18621861
lo = add_layout("play_pause")
18631862
lo.geometry = geo
18641863
lo.style = osc_styles.smallButtonsBar

0 commit comments

Comments
 (0)