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

Add option to control show/hide height for bottom hover #70

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,20 @@ Create `modernz.conf` in your mpv script-opts directory:

### UI [behavior]

| Option | Value | Description |
| --------------- | ----- | ---------------------------------------------------------- |
| showonpause | yes | whether to show osc when paused |
| keeponpause | yes | whether to disable the hide timeout on pause |
| bottomhover | yes | if the osc should only display when hovering at the bottom |
| raisesubs | yes | whether to raise subtitles above the osc when it's shown |
| raisesubamount | 175 | how much subtitles rise when the osc is shown |
| thumbnailborder | 2 | the width of the thumbnail border (thumbfast) |
| OSCfadealpha | 150 | alpha of the background box for the OSC |
| boxalpha | 75 | alpha of the window title bar |
| ontopborder | no | If you pin the window, keep window border? |
| loopinpause | yes | activate looping by right clicking pause |
| visibility | auto | only used at init to set visibility_mode(...) |
| Option | Value | Description |
| ---------------- | ----- | ---------------------------------------------------------- |
| showonpause | yes | whether to show osc when paused |
| keeponpause | yes | whether to disable the hide timeout on pause |
| bottomhover | yes | if the osc should only display when hovering at the bottom |
| bottomhover_zone | 160 | height of show/hide zone for bottomhover |
| raisesubs | yes | whether to raise subtitles above the osc when it's shown |
| raisesubamount | 175 | how much subtitles rise when the osc is shown |
| thumbnailborder | 2 | the width of the thumbnail border (thumbfast) |
| OSCfadealpha | 150 | alpha of the background box for the OSC |
| boxalpha | 75 | alpha of the window title bar |
| ontopborder | no | If you pin the window, keep window border? |
| loopinpause | yes | activate looping by right clicking pause |
| visibility | auto | only used at init to set visibility_mode(...) |

### UI [time-based]

Expand Down
3 changes: 2 additions & 1 deletion modernz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ local user_opts = {
showonpause = true, -- whether to show osc when paused
keeponpause = true, -- whether to disable the hide timeout on pause
bottomhover = true, -- if the osc should only display when hovering at the bottom
bottomhover_zone = 160, -- height of show/hide zone for bottomhover
raisesubs = true, -- whether to raise subtitles above the osc when it's shown
raisesubamount = 175, -- how much subtitles rise when the osc is shown
thumbnailborder = 2, -- the width of the thumbnail border (thumbfast)
Expand Down Expand Up @@ -2290,7 +2291,7 @@ local function process_event(source, what)
)
) then
if user_opts.bottomhover then -- if enabled, only show osc if mouse is hovering at the bottom of the screen (where the UI elements are)
if mouseY > osc_param.playresy - 160 or (not state.border or state.fullscreen) and mouseY < 40 then -- account for scaling options
if mouseY > osc_param.playresy - (user_opts.bottomhover_zone or 160) or (not state.border or state.fullscreen) and mouseY < 40 then -- account for scaling options
show_osc()
else
hide_osc()
Expand Down