Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show seekbar tooltip info while dragging #306

Open
Keith94 opened this issue Jan 11, 2025 · 4 comments
Open

Always show seekbar tooltip info while dragging #306

Keith94 opened this issue Jan 11, 2025 · 4 comments
Labels
feature request New feature or request

Comments

@Keith94
Copy link
Contributor

Keith94 commented Jan 11, 2025

Expected behavior of the wanted feature

Current behavior

  1. Put bottomhover=no
  2. Click and hold seekbar handle
  3. Move mouse above the seekbar
  4. Move mouse left/right

All seekbar information (thumbnail, time stamp, chapter title) disappears unless you're hovering the seek handle.

Desired behavior

Keep all seekbar information prominent even if mouse cursor drifts off the handle while dragging.

@Keith94 Keith94 added the feature request New feature or request label Jan 11, 2025
@Samillion
Copy link
Owner

Samillion commented Jan 23, 2025

In theory, it is possible, just need to modify the mouse hit to add a condition to it.

ModernZ/modernz.lua

Lines 1138 to 1143 in 488854b

-- add tooltip
if element.slider.tooltipF ~= nil and element.enabled then
if mouse_hit(element) then
local sliderpos = get_slider_value(element)
local tooltiplabel = element.slider.tooltipF(sliderpos)
local an = slider_lo.tooltip_an

For example, if we add this before if mouse_hit(element) then:

local force_show_tooltip = element.name == "seekbar"
    and element.eventresponder["mbtn_left_down"]
    and element.state.mbtnleft
    and state.mouse_down_counter > 0

Then replace if mouse_hit(element) then with:

if mouse_hit(element) or force_show_tooltip then

Issues:

  • Not tested
  • Most likely will show thumbnails with volume bar as well
  • force_show_tooltip most likely needs better identifiers to specifically and only work for seekbar, not all sliders
  • There is probably a better method that my brain cannot think of

@Keith94
Copy link
Contributor Author

Keith94 commented Jan 23, 2025

Awesome I can definitely test it out as soon as I can. Let you know if any issues pop up.

@Keith94
Copy link
Contributor Author

Keith94 commented Jan 25, 2025

It mostly works well (way better than current behavior) but with a couple glitches like the one you mentioned:

Most likely will show thumbnails with volume bar as well

There's another glitch, if you drag the progress bar to the beginning or end of the file, click and drag the maximize button, the thumbnail will show up.

mpv_9ca9zhdBFY.mp4

@Samillion
Copy link
Owner

Samillion commented Jan 25, 2025

🤣 Yeah, most likely because of the mouse click counter. Definitely needs a better implementation than this one, as this just adds way too many global parameters not specific to seekbar.

Maybe it should just specifically alter/force show for thumbfast/time tooltips instead of the whole slider element. (ie: slider.lo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants