Skip to content

Commit

Permalink
Merge pull request #185 from Samillion/dev_sliders_thicc
Browse files Browse the repository at this point in the history
refactor: make seekbars a bit thicker
  • Loading branch information
Samillion authored Nov 6, 2024
2 parents 07cc4c7 + 19bc3ee commit fb3913f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A sleek and modern OSC for [mpv](https://mpv.io/), this project is a fork of ModernX designed to enhance functionality by adding more features, all while preserving the core standards of mpv's OSC.

![modernz-osc](https://github.com/user-attachments/assets/88183ead-0077-4bd1-b8cb-54d2953728c5)
![modernz-osc](https://github.com/user-attachments/assets/b642c5b6-b9cb-423e-af4f-c1772652853b)

<p align="center">
<a href="#installation"><strong>Installation »</strong></a>
Expand Down
12 changes: 9 additions & 3 deletions docs/IMAGE_VIEWER.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A minimal layout is automatically applied when viewing images while using ModernZ osc, which also features zoom controls.

![image](https://github.com/user-attachments/assets/e602b931-fc78-4171-b49b-6731521c6225)
![image-viewer](https://github.com/user-attachments/assets/d95942c8-0b62-47f9-bca6-8adfaab63538)

## Zoom Controls

Expand All @@ -22,12 +22,18 @@ Reset values on next file:
reset-on-next-file=video-rotate,video-zoom,panscan,video-unscaled,video-align-x,video-align-y
```

Auto profile for images only that applies useful mpv options and ModernZ [user options](/docs/USER_OPTS.md):
Auto profiles that apply useful mpv options and ModernZ [user options](/docs/USER_OPTS.md) in `Image Viewer` mode:
```ini
[Image-Viewer]
[Video]
profile-cond=p["current-tracks/video"] and not p["current-tracks/video"].image
taskbar-progress=yes

[Image]
profile-desc=Settings for Image Viewer mode with ModernZ osc
profile-cond=p["current-tracks/video"] and p["current-tracks/video"].image and not p["current-tracks/video"].albumart
image-display-duration=inf
prefetch-playlist=yes
taskbar-progress=no
stop-screensaver=no
title=${media-title} [${?width:${width}x${height}}]
script-opts-append=modernz-windowcontrols_title=${media-title} [${?width:${width}x${height}}]
Expand Down
2 changes: 1 addition & 1 deletion docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| hover_effect | size,glow,color | active button hover effects: `"glow"`, `"size"`, `"color"`; can use multiple separated by commas |
| hover_button_size | 115 | relative size of a hovered button if "size" effect is active |
| button_glow_amount | 5 | glow intensity when `"glow"` hover effect is active |
| hover_effect_for_sliders | yes | apply hover effects to slider handles |
| hover_effect_for_sliders | no | apply hover effects to slider handles |

### Tooltips and hints

Expand Down
2 changes: 1 addition & 1 deletion modernz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ hover_button_size=115
# glow intensity when "glow" hover effect is active
button_glow_amount=5
# apply hover effects to slider handles
hover_effect_for_sliders=yes
hover_effect_for_sliders=no

# Tooltips and hints
# enable tooltips for disabled buttons and elements
Expand Down
22 changes: 11 additions & 11 deletions modernz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ local user_opts = {
hover_effect = "size,glow,color", -- active button hover effects: "glow", "size", "color"; can use multiple separated by commas
hover_button_size = 115, -- relative size of a hovered button if "size" effect is active
button_glow_amount = 5, -- glow intensity when "glow" hover effect is active
hover_effect_for_sliders = true, -- apply hover effects to slider handles
hover_effect_for_sliders = false, -- apply hover effects to slider handles

-- Tooltips and hints
tooltips_for_disabled_elements = true, -- enable tooltips for disabled buttons and elements
Expand Down Expand Up @@ -1582,7 +1582,7 @@ layouts["modern"] = function ()

-- Controller Background
local lo, geo

new_element("box_bg", "box")
lo = add_layout("box_bg")
lo.geometry = {x = posX, y = posY, an = 7, w = osc_w, h = 1}
Expand All @@ -1598,27 +1598,27 @@ layouts["modern"] = function ()
lo.layer = 10
lo.alpha[3] = 0
end

-- Alignment
local refX = osc_w / 2
local refY = posY

-- Seekbar
new_element("seekbarbg", "box")
lo = add_layout("seekbarbg")
lo.geometry = {x = refX , y = refY - 100, an = 5, w = osc_geo.w - 50, h = 2}
lo.geometry = {x = refX, y = refY - 100, an = 5, w = osc_geo.w - 50, h = 6}
lo.layer = 13
lo.style = osc_styles.seekbar_bg
lo.alpha[1] = 128
lo.alpha[3] = 128

lo = add_layout("seekbar")
lo.geometry = {x = refX, y = refY - 100, an = 5, w = osc_geo.w - 50, h = 16}
lo.geometry = {x = refX, y = refY - 100, an = 5, w = osc_geo.w - 50, h = 20}
lo.style = osc_styles.seekbar_fg
lo.slider.gap = 7
lo.slider.tooltip_style = osc_styles.tooltip
lo.slider.tooltip_an = 2

if user_opts.persistentprogress or state.persistentprogresstoggle then
lo = add_layout("persistentseekbar")
lo.geometry = {x = refX, y = refY, an = 5, w = osc_geo.w, h = user_opts.persistentprogressheight}
Expand Down Expand Up @@ -1745,13 +1745,13 @@ layouts["modern"] = function ()
lo = new_element("volumebarbg", "box")
lo.visible = (osc_param.playresx >= 950 - outeroffset) and user_opts.volume_control
lo = add_layout("volumebarbg")
lo.geometry = {x = 200 - (playlist_button and 0 or 45), y = refY - 40, an = 4, w = 80, h = 2}
lo.geometry = {x = 200 - (playlist_button and 0 or 45), y = refY - 40, an = 4, w = 80, h = 4}
lo.layer = 13
lo.alpha[1] = 128
lo.style = user_opts.volumebar_match_seek_color and osc_styles.seekbar_bg or osc_styles.volumebar_bg

lo = add_layout("volumebar")
lo.geometry = {x = 200 - (playlist_button and 0 or 45), y = refY - 40, an = 4, w = 80, h = 8}
lo.geometry = {x = 200 - (playlist_button and 0 or 45), y = refY - 40, an = 4, w = 80, h = 10}
lo.style = user_opts.volumebar_match_seek_color and osc_styles.seekbar_fg or osc_styles.volumebar_fg
lo.slider.gap = 3
lo.slider.tooltip_style = osc_styles.tooltip
Expand Down Expand Up @@ -1882,13 +1882,13 @@ layouts["modern-image"] = function ()
lo = new_element("zoom_control_bg", "box")
lo.visible = osc_param.playresx >= 450 - outeroffset and user_opts.zoom_control
lo = add_layout("zoom_control_bg")
lo.geometry = {x = 145 - (playlist_button and 0 or 25) - (track_nextprev_buttons and 0 or 70), y = refY - 40, an = 4, w = 80, h = 2}
lo.geometry = {x = 145 - (playlist_button and 0 or 25) - (track_nextprev_buttons and 0 or 70), y = refY - 40, an = 4, w = 80, h = 4}
lo.layer = 13
lo.alpha[1] = 128
lo.style = osc_styles.volumebar_bg

lo = add_layout("zoom_control")
lo.geometry = {x = 145 - (playlist_button and 0 or 25) - (track_nextprev_buttons and 0 or 70), y = refY - 40, an = 4, w = 80, h = 8}
lo.geometry = {x = 145 - (playlist_button and 0 or 25) - (track_nextprev_buttons and 0 or 70), y = refY - 40, an = 4, w = 80, h = 10}
lo.style = osc_styles.volumebar_fg
lo.slider.gap = 3
lo.slider.tooltip_style = osc_styles.tooltip
Expand Down

0 comments on commit fb3913f

Please sign in to comment.