feat: anchor tooltips above seekbar with styled pill box#606
feat: anchor tooltips above seekbar with styled pill box#606Samillion merged 7 commits intoSamillion:mainfrom
Conversation
Changes: * Button and volumebar hover tooltips now appear at a consistent position * Extend pill box to volumebar and button tooltips * Increase horizontal padding back to 5px * Remove redundant options
|
Terribly sorry about the late response, ended up spending the night at a friend's. Excellent work. One issue, if you have The unified function you made is great, but since it does two things, you need to reset to default state twice. (for each event) For example: -- draw a pill-shaped tooltip background box and label
local function draw_tooltip(ass, tx, ty, width, style, label, alpha)
local fs = user_opts.tooltip_font_size
local ph, pv = 5, 3
-- draw tooltip box
ass:new_event()
ass:append("{\\rDefault\\alpha&H80&}")
ass:pos(tx - width / 2 - ph, ty - fs - pv)
ass:an(7)
ass:append(osc_styles.tooltip_box)
ass:draw_start()
ass:round_rect_cw(0, 0, width + 2 * ph, fs + 2 * pv, (fs + 2 * pv) / 2)
ass:draw_stop()
-- add tooltip
ass:new_event()
ass:append("{\\rDefault}")
ass:pos(tx, ty)
ass:an(2)
ass:append(style)
if alpha then ass_append_alpha(ass, alpha, 0) end
ass:append(label)
endI'll be able to help better once I'm back home. Again, terribly sorry about the delay. |
|
Ah, this is why I rely on your expertise lol. Glad you like it though. Please investigate, make any changes you need or I can adjust that later. 🙏 |
|
Looks great. I have a question, but keep in my mind these are questions, not suggestions.
|
I initially felt it looked too busy with tooltips and multiple elements on top of each other, especially with the new box effect. Since we can now change osc height, I was going to suggest decrease the height to 62-63 for a more minimal look once the tooltips were out of the way. YouTube has a similar approach. But let me know what you think. |
This sounds very nice. Agreed. |
|
Since this is inspired by YouTube: |
|
If we do decide OSC height to be 62 (or 60?), we should:
|
|
Sorry for the additional comment. Right now, the seek bar tooltips (time/chapter/thumbnail) are drawn on-top of title/chapter title. So the behavior already exists, right? So having all tooltips show there, unified, wouldn't be a problem, right? So it all goes to the questions from my previous comment
|
|
I think the title and chapter is basic info and shouldn't be disabled by default. |
|
Alright. What about the other adjustments, good? Or do you think button tooltips should not be above seek bar? |
|
Sorry, correction:
|
I don't really mind the tooltips being above the progress. I just pointed out the reason why YT does it this way is due to their constraints Most of the time I don't really know what to say because many changes feel like opinions and there isn't a consistent rule to follow, plus I don't use modernz myself, so I don't really know what users expect or prefer. I usually just leave these kinds of decisions up to you, either way is fine. |
|
30% alpha is a lot easier to read especially when it's overlapping other text. A height of 60 looks great as well. |
|
Changes:
|
|
I can confirm when I'm home. I'll spend more time with it. Thanks for all the fixes btw |
|
I now see how 30% is better (what is currently used), definitely makes reading tooltip consistent, especially for old farts like me who might squint to read stuff. 😝 I didn't have problems with 40% though, so I'm fine with either one. |
|
The seek tooltip appears to be anchored a little higher than button tooltips. It should probably come down to match.
I would also agree to set to 60; there's still a good amount of padding so nothing overlaps. |
|
Sounds good. Could you make the adjustments please? I'm currently preparing a locale change, if you don't mind and if it's not a bother. |
Also default osc_height to 60.
|
No worries, I made the changes. |
Looks good to me! Great job all. |
|
Thank you very much for your effort. |
|
You as well. It's oddly satisfying seeing all the repetitive code nuked out of existence. |
Indeed. All thanks to the function you created, well done. Side note: My god, updating all the previews was a pain in the ass lol. I want a better main preview image, with a higher quality, but I can't be bothered after all that. 😝 |
|
Previews look very nice. Never even thought to set options through console like that. Not sure what happened, but the volume slider tooltip is offset slightly lower. Weird. |
Ah, nice catch. It's the added Could be solved by setting an offset -ty = ref_el.hitbox.y1 + elem_geo.h / 2 - user_opts.tooltip_height_offset - image_mode_offset
+local offset = (ref_el == element) and (elem_geo.h / 2) or 0
+ty = ref_el.hitbox.y1 + offset - user_opts.tooltip_height_offset - image_mode_offsetBut I don't like using the name I dunno, I hate naming things lol. |
|
That does indeed solve it. Do you want me to add that? |
Yes please, that would be awesome. I'm working on optimizing loading external locales at the moment. |
|
You are a machine.. lol I'll try to combine it with another fix (hopefully I won't break anything else). |
😆 The code base is so close to actually reaching a clean and well optimized state. I cannot wait for that to happen, because it means less frequent updates and a stable behavior overall.
Thank you very much ❤️ |




Changes: