@@ -184,8 +184,7 @@ local user_opts = {
184
184
time_codes_height = 35 , -- time codes height position
185
185
time_codes_centered_height = 57 , -- time codes height position with portrait window
186
186
tooltip_height_offset = 2 , -- tooltip height position offset
187
- tooltip_left_offset = 3 , -- if tooltip contains many characters, it is moved to the left by offset
188
- tooltip_cache_speed_offset = 5 , -- if cache speed is enabled, adjust the main tooltip for cache
187
+ tooltip_left_offset = 5 , -- if tooltip contains many characters, it is moved to the left by offset
189
188
portrait_window_trigger = 930 , -- portrait window width trigger to move some elements
190
189
hide_volume_bar_trigger = 1150 , -- hide volume bar trigger window width
191
190
notitle_osc_h_offset = 25 , -- osc height offset if title above seekbar is disabled
@@ -1283,7 +1282,7 @@ local function render_elements(master_ass)
1283
1282
local hoverstyle = button_lo .hoverstyle
1284
1283
if hovered and (contains (user_opts .hover_effect , " size" ) or contains (user_opts .hover_effect , " color" )) then
1285
1284
-- remove font scale tags for these elements, it looks out of place
1286
- if element .name == " title" or element .name == " time_codes" or element .name == " chapter_title" then
1285
+ if element .name == " title" or element .name == " time_codes" or element .name == " chapter_title" or element . name == " cache_info " then
1287
1286
hoverstyle = hoverstyle :gsub (" \\ fscx%d+\\ fscy%d+" , " " )
1288
1287
end
1289
1288
elem_ass :append (hoverstyle .. buttontext )
@@ -1301,15 +1300,14 @@ local function render_elements(master_ass)
1301
1300
1302
1301
-- add tooltip for button elements
1303
1302
if element .tooltipF ~= nil and (user_opts .tooltips_for_disabled_elements or element .enabled ) then
1304
- local cache_info_offset = (element .name == " cache_info" and user_opts .cache_info_speed ) and user_opts .tooltip_cache_speed_offset or 0
1305
1303
if mouse_hit (element ) then
1306
1304
local tooltiplabel = element .tooltipF
1307
1305
local an = 1
1308
- local ty = element .hitbox .y1 - user_opts .tooltip_height_offset + cache_info_offset
1306
+ local ty = element .hitbox .y1 - user_opts .tooltip_height_offset
1309
1307
local tx = get_virt_mouse_pos ()
1310
1308
1311
1309
if ty < osc_param .playresy / 2 then
1312
- ty = element .hitbox .y2 - user_opts .tooltip_height_offset + cache_info_offset
1310
+ ty = element .hitbox .y2 - user_opts .tooltip_height_offset
1313
1311
an = 7
1314
1312
end
1315
1313
@@ -1757,7 +1755,6 @@ layouts["modern"] = function ()
1757
1755
local loop_button = user_opts .loop_button
1758
1756
local speed_button = user_opts .speed_button
1759
1757
local download_button = user_opts .download_button and state .is_URL
1760
- local cache_speed = user_opts .cache_info_speed
1761
1758
local playlist_button = user_opts .playlist_button and (not user_opts .hide_empty_playlist_button or mp .get_property_number (" playlist-count" , 0 ) > 1 )
1762
1759
1763
1760
local offset = jump_buttons and 60 or 0
@@ -1941,14 +1938,8 @@ layouts["modern"] = function ()
1941
1938
local cache_x_offset = (download_button and 0 or 45 ) + (speed_button and 0 or 45 ) + (loop_button and 0 or 45 ) + (screenshot_button and 0 or 45 ) + (ontop_button and 0 or 45 ) + (info_button and 0 or 45 ) + (fullscreen_button and 0 or 45 )
1942
1939
1943
1940
lo = add_layout (" cache_info" )
1944
- lo .geometry = {x = osc_geo .w - ( cache_speed and 345 or 340 ) + cache_x_offset , y = refY - ( cache_speed and 41 or 35 ) , an = 6 , w = 35 , h = 24 }
1941
+ lo .geometry = {x = osc_geo .w - 345 + cache_x_offset , y = refY - 35 , an = 6 , w = ( user_opts . cache_info_speed and 70 or 45 ) , h = 24 }
1945
1942
lo .style = osc_styles .cache
1946
-
1947
- if user_opts .cache_info_speed then
1948
- lo = add_layout (" cache_info_speed" )
1949
- lo .geometry = {x = osc_geo .w - 345 + cache_x_offset , y = refY - 27 , an = 6 , w = 35 , h = 24 }
1950
- lo .style = osc_styles .cache
1951
- end
1952
1943
end
1953
1944
end
1954
1945
@@ -2606,22 +2597,17 @@ local function osc_init()
2606
2597
local sec = math.floor (dmx_cache % 60 ) -- don't round e.g. 59.9 to 60
2607
2598
local cache_time = (min > 0 and string.format (" %sm%02.0fs" , min , sec ) or string.format (" %3.0fs" , sec ))
2608
2599
2609
- return state .buffering and locale .buffering .. " : " .. mp .get_property (" cache-buffering-state" ) .. " %" or cache_time
2610
- end
2611
- ne .tooltip_style = osc_styles .tooltip
2612
- ne .tooltipF = (user_opts .tooltip_hints and cache_enabled ()) and locale .cache or " "
2613
-
2614
- -- cache info speed
2615
- ne = new_element (" cache_info_speed" , " button" )
2616
- ne .visible = (osc_param .playresx >= 1250 - outeroffset - (user_opts .speed_button and 0 or 100 ) - (user_opts .loop_button and 0 or 100 ) - (user_opts .screenshot_button and 0 or 100 ) - (user_opts .ontop_button and 0 or 100 ) - (user_opts .info_button and 0 or 100 ) - (user_opts .fullscreen_button and 0 or 100 ))
2617
- ne .content = function ()
2618
- if not cache_enabled () then return " " end
2619
2600
local dmx_speed = state .cache_state [" raw-input-rate" ] or 0
2620
2601
local cache_speed = utils .format_bytes_humanized (dmx_speed )
2621
2602
local number , unit = cache_speed :match (" ([%d%.]+)%s*(%S+)" )
2603
+ local cache_info = state .buffering and locale .buffering .. " : " .. mp .get_property (" cache-buffering-state" ) .. " %" or cache_time
2604
+ local cache_info_speed = string.format (" %8s %4s/s" , number , unit )
2622
2605
2623
- return string.format ( " %8s %4s/s " , number , unit )
2606
+ return user_opts . cache_info_speed and cache_info .. " \\ N " .. cache_info_speed or cache_info
2624
2607
end
2608
+ ne .tooltip_style = osc_styles .tooltip
2609
+ ne .tooltipF = (user_opts .tooltip_hints and cache_enabled ()) and locale .cache or " "
2610
+ ne .eventresponder [" mbtn_left_up" ] = function () mp .command (" script-binding stats/display-page-3" ) end
2625
2611
2626
2612
-- seekbar
2627
2613
ne = new_element (" seekbar" , " slider" )
0 commit comments