@@ -39,6 +39,7 @@ local user_opts = {
39
39
bottomhover_zone = 130 , -- height of hover zone for bottomhover (in pixels)
40
40
osc_on_seek = false , -- show OSC when seeking
41
41
mouse_seek_pause = true , -- pause video while seeking with mouse move (on button hold)
42
+ force_seek_tooltip = false , -- force show seedkbar tooltip on mouse drag, even if not hovering seekbar
42
43
43
44
vidscale = " auto" , -- scale osc with the video
44
45
scalewindowed = 1.0 , -- osc scale factor when windowed
@@ -511,9 +512,8 @@ local state = {
511
512
initialborder = mp .get_property (" border" ),
512
513
playtime_hour_force_init = false , -- used to force request_init() once
513
514
playtime_nohour_force_init = false , -- used to force request_init() once
514
- playingWhilstSeeking = false ,
515
- playingWhilstSeekingWaitingForEnd = false ,
516
- persistentprogresstoggle = user_opts .persistentprogress ,
515
+ playing_and_seeking = false ,
516
+ persistent_progress_toggle = user_opts .persistentprogress ,
517
517
original_subpos = mp .get_property_number (" sub-pos" ) or 100 ,
518
518
downloaded_once = false ,
519
519
downloading = false ,
@@ -1139,7 +1139,13 @@ local function render_elements(master_ass)
1139
1139
1140
1140
-- add tooltip
1141
1141
if element .slider .tooltipF ~= nil and element .enabled then
1142
- if mouse_hit (element ) then
1142
+ local force_seek_tooltip = user_opts .force_seek_tooltip
1143
+ and element .name == " seekbar"
1144
+ and element .eventresponder [" mbtn_left_down" ]
1145
+ and element .state .mbtnleft
1146
+ and state .mouse_down_counter > 0
1147
+ and state .playing_and_seeking
1148
+ if mouse_hit (element ) or force_seek_tooltip then
1143
1149
local sliderpos = get_slider_value (element )
1144
1150
local tooltiplabel = element .slider .tooltipF (sliderpos )
1145
1151
local an = slider_lo .tooltip_an
@@ -1703,7 +1709,7 @@ layouts["modern"] = function ()
1703
1709
lo .slider .tooltip_style = osc_styles .tooltip
1704
1710
lo .slider .tooltip_an = 2
1705
1711
1706
- if user_opts .persistentprogress or state .persistentprogresstoggle then
1712
+ if user_opts .persistentprogress or state .persistent_progress_toggle then
1707
1713
lo = add_layout (" persistentseekbar" )
1708
1714
lo .geometry = {x = refX , y = refY , an = 5 , w = osc_geo .w , h = user_opts .persistentprogressheight }
1709
1715
lo .style = osc_styles .seekbar_fg
@@ -2247,7 +2253,7 @@ local function osc_init()
2247
2253
ne .content = function ()
2248
2254
if mp .get_property (" eof-reached" ) == " yes" then
2249
2255
return icons .replay
2250
- elseif mp .get_property (" pause" ) == " yes" and not state .playingWhilstSeeking then
2256
+ elseif mp .get_property (" pause" ) == " yes" and not state .playing_and_seeking then
2251
2257
return icons .play
2252
2258
else
2253
2259
return icons .pause
@@ -2669,8 +2675,8 @@ local function osc_init()
2669
2675
-- mouse move events may pile up during seeking and may still get
2670
2676
-- sent when the user is done seeking, so we need to throw away
2671
2677
-- identical seeks
2678
+ state .playing_and_seeking = true
2672
2679
if mp .get_property (" pause" ) == " no" and user_opts .mouse_seek_pause then
2673
- state .playingWhilstSeeking = true
2674
2680
mp .commandv (" cycle" , " pause" )
2675
2681
end
2676
2682
local seekto = get_slider_value (element )
@@ -2713,11 +2719,11 @@ local function osc_init()
2713
2719
end
2714
2720
ne .eventresponder [" reset" ] = function (element )
2715
2721
element .state .lastseek = nil
2716
- if state .playingWhilstSeeking then
2717
- if mp .get_property (" eof-reached" ) == " no" then
2722
+ if state .playing_and_seeking then
2723
+ if mp .get_property (" eof-reached" ) == " no" and user_opts . mouse_seek_pause then
2718
2724
mp .commandv (" cycle" , " pause" )
2719
2725
end
2720
- state .playingWhilstSeeking = false
2726
+ state .playing_and_seeking = false
2721
2727
end
2722
2728
end
2723
2729
ne .eventresponder [" wheel_up_press" ] = function () mp .commandv (" seek" , 10 ) end
@@ -3197,7 +3203,7 @@ local function render()
3197
3203
render_elements (ass )
3198
3204
end
3199
3205
3200
- if user_opts .persistentprogress or state .persistentprogresstoggle then
3206
+ if user_opts .persistentprogress or state .persistent_progress_toggle then
3201
3207
render_persistentprogressbar (ass )
3202
3208
end
3203
3209
@@ -3559,7 +3565,7 @@ end)
3559
3565
mp .add_key_binding (nil , " visibility" , function () visibility_mode (" cycle" ) end )
3560
3566
mp .add_key_binding (nil , " progress-toggle" , function ()
3561
3567
user_opts .persistentprogress = not user_opts .persistentprogress
3562
- state .persistentprogresstoggle = user_opts .persistentprogress
3568
+ state .persistent_progress_toggle = user_opts .persistentprogress
3563
3569
request_init ()
3564
3570
end )
3565
3571
mp .register_script_message (" osc-idlescreen" , idlescreen_visibility )
0 commit comments