refactor: tooltip positioning logic#543
Conversation
|
So I’ve been trying combinations to see how it worked before. It seems the current hovered chapter replaces either the title or the active chapter text, unless both are disabled, in which case it finally falls back to the tooltip. This replace the title approach was a result mpv stock osc design limitations (thick progress bar where the tooltip is displayed inside), and because early versions of ModernX didn't display chapter names either, this code was adopted. However, when po5 added thumbnail support to ModernX, they implemented chapter display as a proper tooltip. Even in the thumbnail version of the stock osc, the title replacement behaviour was kept rather than using the tooltip, likely due to the stock layout. Now that we have a proper tooltip system, the title replacement feels redundant and inconsistent from a UX perspective. So, do we want to keep this legacy behaviour, or move to a tooltip only approach? |
Tooltip only seems way better. It's much easier to follow the tooltip to see content changes compared to the OSC title where it's just a static element. |
|
Agreed. Though both should remain, since we have tooltips disable/enable option. This way, no one will be upset. Let me know when it's ready to merge. |
What option do you mean? |
|
True! Completely forgot about that. Yup, leaving this up to you guys. My brain is extra pretending to exist today lol. Let me know when it's ready to merge, please. |
|
Since the seek bar tooltip is always active, and the old title replacement logic was suppressing it based on unrelated user options. I'm removing the replacement code to keep it tooltip only. Ready to merge. |
|
Beautiful. Thank you very much. Merging. |
Improved tooltip positioning. Adds estimate_text_width() function using mpv's osd overlay to calculate actual text widths, enabling proper horizontal boundary clamping so tooltips stay within screen edges.
fixes: #541