diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2016-10-26 17:53:54 +0100 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2016-10-29 18:14:30 +0100 |
commit | 0c3e4b13ac6381eedafa502ad3d2a64ae65b54c0 (patch) | |
tree | 353b35f3e47133333b7912e000fa5d023eccf132 /player | |
parent | 22133f8efc7b1593ba79c56065c8c06b5055c45a (diff) |
osc: top/bottombar: scale title if too large like box
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/osc.lua | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 3a6328d7e2..259ca9cdc6 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1179,12 +1179,7 @@ layouts["bottombar"] = function() lo.geometry = geo lo.style = osc_styles.topButtons - -- Title - geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, - w = 1000, h = geo.h } - lo = add_layout("title") - lo.geometry = geo - lo.style = osc_styles.vidtitle + local t_l = geo.x + geo.w + padX -- Cache geo = { x = osc_geo.x + osc_geo.w - padX, y = geo.y, @@ -1193,6 +1188,16 @@ layouts["bottombar"] = function() lo.geometry = geo lo.style = osc_styles.vidtitle + local t_r = geo.x - geo.w - padX*2 + + -- Title + geo = { x = t_l, y = geo.y, an = 4, + w = t_r - t_l, h = geo.h } + lo = add_layout("title") + lo.geometry = geo + lo.style = osc_styles.vidtitle + lo.button.maxchars = math.floor(geo.w/4) + -- Playback control buttons geo = { x = osc_geo.x + padX, y = line2, an = 4, @@ -1398,19 +1403,24 @@ layouts["topbar"] = function() lo.geometry = geo lo.style = osc_styles.topButtons - -- Title - geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, - w = 1000, h = geo.h } - lo = add_layout("title") - lo.geometry = geo - lo.style = osc_styles.vidtitle + local t_l = geo.x + geo.w + padX -- Cache - geo = { x = osc_geo.x + osc_geo.w - padX, y = geo.y, an = 6, - w = 100, h = geo.h } + geo = { x = osc_geo.x + osc_geo.w - padX, y = geo.y, + an = 6, w = 100, h = geo.h } lo = add_layout("cache") lo.geometry = geo lo.style = osc_styles.vidtitle + + local t_r = geo.x - geo.w - padX*2 + + -- Title + geo = { x = t_l, y = geo.y, an = 4, + w = t_r - t_l, h = geo.h } + lo = add_layout("title") + lo.geometry = geo + lo.style = osc_styles.vidtitle + lo.button.maxchars = math.floor(geo.w/4) end -- Validate string type user options |