Skip to content

Bottomhover refactor idea #197

Closed
Closed

Description

@Keith94

What would you like to discuss?

Since the project was based around osc.lua standards I wanted to ask something.

The way bottomhover and bottomhover_zone works is similar to the way mpv handles the deadzonesize option in stock osc.lua.

So do you think we could squash the bottomhover options into just one? Remove the toggle completely and have deadzone values similar to previous Modernx forks:

https://github.com/dexeonify/mpv-config/blob/63b6156a536b24189d8793496e4959f41822a0b0/scripts/modernx.lua#L1300-L1307

Activity

  1. Samillion commented on Nov 9, 2024

    @Samillion
    Owner

    Good point. I've never actually tried the deadzonesize option.

    get_align(1 - (2 * user_opts.deadzonesize)
    function get_align(align, frame, obj, margin)
        return (frame / 2) + (((frame / 2) - margin - (obj / 2)) * align)
    end
        -- deadzone above OSC
        local sh_area_y0, sh_area_y1
        sh_area_y0 = get_align(-1 + (2*user_opts.deadzonesize),
                               posY - osc_geo.h, 0, 0)
        sh_area_y1 = osc_param.playresy - user_opts.barmargin

    Hmm. How would it be different though? I still don't quite understand the math behind it. In essence it makes everything between mouse position and osc top a deadzone in a negative value?

  2. Keith94 commented on Nov 9, 2024

    @Keith94
    ContributorAuthor

    Honestly not sure about the math portion, but according to docs

    0 means the OSC will always popup with mouse movement in the window, and 1 means the OSC will only show up when the mouse hovers.

    I guess it depends on what implementation you prefer since the end result is kinda similar to what we have. Deadzonesize=0.5 seems similar to bottomhover_zone=500 or so.

  3. Samillion commented on Nov 9, 2024

    @Samillion
    Owner

    Interesting. From a user's standpoint, which method do you think would be preferable?

    I'll setup a no-config with osc.lua when I'm back home tomorrow to try it out, I honestly don't know which one is more user friendly, would love your take on it. If it's not a bother.

  4. Keith94 commented on Nov 9, 2024

    @Keith94
    ContributorAuthor

    I couldn't sleep so I was comparing the two behaviors just now. The big difference that stands out to me is that deadzonesize also affects the window title and controls.

    For example, deadzonesize=0.75, moving your mouse from center of the screen to the top bar triggers it more quickly. For deadzonesize=1 you need to hover the top bar directly. Same with bottom controls.

    By design the bottomhover_zone doesn't care about showing the top bar in respect to your cursor position except when hovering it directly.

    My initial impression is that deadzonesize is more user-friendly since it adjusts both the top and bottom zones simultaneously. It also follows what mpv uses which some users might already be familiar with.

  5. Samillion commented on Nov 9, 2024

    @Samillion
    Owner

    That sounds really good. It would probably even make area based show easier. (ie: when you hover to top, only window title bar shows, not entire OSC).

    I'll most likely apply this eventually. My delay would be for fixing up the old code, it's the next step right now, you'll start seeing PRs about a lot of logic simplifying and redundancy removals.

    The real reason though, I need to understand how this works first. I glanced at it, it also accounts for video margins, which isn't applied yet on ModernZ.

    Though if someone created a PR to apply all of that, I'd very much welcome it. Otherwise, it'll take some time.

    The idea is 100% solid though. I just don't want to copy/paste blindly, because if something breaks, it'll apply unnecessary stress into trying to figure it out.

    As I mentioned to you before, I hate math. 😆

  6. Keith94 commented on Nov 9, 2024

    @Keith94
    ContributorAuthor

    I completely understand you. Consider this a very low priority due to the complexity of the feature lol.

    It would probably even make area based show easier.

    This would be useful to have. I assume the code would involve a bit different math going that route instead. Could define set area boundaries or have fine adjustment for where the areas start and end.

    Not sure yet what a good default behavior would be, but everyone here is free to discuss of course.

  7. added
    help wanted
    enhancement
    and removed on Nov 13, 2024
  8. Repository owner locked and limited conversation to collaborators on Nov 14, 2024
  9. converted this issue into a discussion #212 on Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions