-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Rounded slider #2365
Comments
It does, the other layout just sets it to 0 thickness. Edit: Actually, since the "knob" should go outside of the line at the end points, we still need to keep the box, just draw it with 0 thickness, otherwise the slider will start to move around around the endpoints because the canvas size changes. |
I'll fix that this weekend and write this slider with another name. |
This is the new slider. I can't remove the rectangular area without change the loyouts. --- /tmp/osc.lua
+++ /home/leiserfg/.config/mpv/scripts/osc.lua
@@ -361,7 +361,7 @@
local foV = slider_lo.border + slider_lo.gap
-- calculate positions of min and max points
- if (slider_lo.stype == "slider") then
+ if (slider_lo.stype == "slider" or slider_lo.stype == "knob") then
element.slider.min.ele_pos = elem_geo.h / 2
element.slider.max.ele_pos = elem_geo.w - (elem_geo.h / 2)
@@ -541,6 +541,17 @@
elem_ass:line_to(xp+(innerH/2), (innerH/2)+foV)
elem_ass:line_to(xp, (innerH)+foV)
elem_ass:line_to(xp-(innerH/2), (innerH/2)+foV)
+ elseif (slider_lo.stype == "knob") then
+ elem_ass:rect_cw(xp, (9*innerH/20)+foV, elem_geo.w - foH, (11*innerH/20)+foV)
+
+ elem_ass:rect_cw(foH, (3*innerH/8)+foV, xp, (5*innerH/8)+foV)
+
+ elem_ass:round_rect_cw(
+ xp - innerH/2,
+ foV ,
+ xp + innerH/2,
+ foV + innerH,
+ innerH/2.0)
end
end
@@ -1275,7 +1286,9 @@
end
if user_opts.seekbarstyle ~= "slider" and
- user_opts.seekbarstyle ~= "bar" then
+ user_opts.seekbarstyle ~= "bar" and
+ user_opts.seekbarstyle ~= "knob" then
+
msg.warn("Invalid setting \"" .. user_opts.seekbarstyle
.. "\" for seekbarstyle")
user_opts.seekbarstyle = "slider"
|
Whatever happened to this? (Also, should be a pull request.) |
I'll take a look, when I remember to. But probably still needs some more tweaks. |
Most code from @leiserfg in mpv-player#2365. Closes mpv-player#2365
Most code from @leiserfg in mpv-player#2365. Closes mpv-player#2365
I made this change to make the OSD look better (from my point of view) could replace the default slider or officially become a new one?
The text was updated successfully, but these errors were encountered: