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

feat: reduce OSC footprint by making it more compact #271

Merged
merged 23 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
058fb6e
feat: reduce OSC footprint by making it more compact
Samillion Dec 26, 2024
2ee659c
refactor: improve elements position and width
Samillion Dec 26, 2024
52b77e6
refactor: increase chapter_title padding
Samillion Dec 26, 2024
c75e35e
fix: align chapter_title with title
Samillion Dec 26, 2024
22d73df
refactor: lower seek bar position by 3 pixels
Samillion Dec 26, 2024
562b264
fix: correctly position time codes based on font size
Samillion Dec 27, 2024
8331357
fix: display time codes and cache info correctly
Samillion Dec 27, 2024
e9c1c98
refactor: unify cache info tooltip with locale.cache
Samillion Dec 27, 2024
138e263
refactor: improve osc elements display and hover behavior
Samillion Dec 28, 2024
87478e5
fix: display cache_info_speed correctly according to cache_state
Samillion Dec 28, 2024
245127d
fix: only display cache tooltip if cache ranges exist
Samillion Dec 28, 2024
7dd1264
docs: update main preview
Samillion Dec 28, 2024
65027fa
docs: update history
Samillion Dec 28, 2024
4383a1b
comment: update fork history
Samillion Dec 28, 2024
1e40c28
conf: update options values to match recent changes
Samillion Dec 28, 2024
add3479
docs: update option values to match recent changes
Samillion Dec 28, 2024
55c6917
refactor: correct comments to reflect recent changes
Samillion Dec 28, 2024
8cec574
docs: correct comments for options to reflect recent changes
Samillion Dec 28, 2024
aad9ee1
docs: add syntax highlight for configuration
Samillion Dec 28, 2024
426f621
refactor: add locale.chapter as a label
Samillion Dec 28, 2024
dc7ea01
docs: update color customization previews
Samillion Dec 28, 2024
ca2bb91
docs: update time codes behavior and update controls preview
Samillion Dec 28, 2024
91414ce
docs: update interactive menus preview
Samillion Dec 28, 2024
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
10 changes: 5 additions & 5 deletions 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/03ea7f7d-7963-4ced-867e-4562460bbf0e)
![modernz_osc](https://github.com/user-attachments/assets/ef4ad6aa-2545-4aa4-b5e9-5e2c555ccc4d)

<p align="center">
<a href="#installation"><strong>Installation »</strong></a>
Expand Down Expand Up @@ -32,9 +32,9 @@ A sleek and modern OSC for [mpv](https://mpv.io/), this project is a fork of Mod

Don't like the default white buttons and text? ModernZ is fully customizable! Change colors and button layouts to match your style:

![modernz-osc_colors_top](https://github.com/user-attachments/assets/b5f04e5d-91d0-41ae-ba14-ebac4b45aaa5)
![modernz_osc_colors_top](https://github.com/user-attachments/assets/4fe06ecc-9416-4686-aece-bf1e52189207)

![modernz-osc_colors_bottom](https://github.com/user-attachments/assets/a29bb34e-14e9-4702-9ef3-9f308e71237d)
![modernz_osc_colors_bottom](https://github.com/user-attachments/assets/6fcc41c2-3684-4ddd-9be0-d4930a4ee2bd)

See the [Color Customization](docs/USER_OPTS.md#colors-and-style) section in the configuration guide for details on how to customize colors and buttons.

Expand Down Expand Up @@ -84,7 +84,7 @@ ModernZ supports mpv's built-in console/select ([v0.39+](https://github.com/mpv-

2. Example short configuration:

```
```EditorConfig
# Seekbar colors (Hex format)
seekbarfg_color=#B7410E

Expand Down Expand Up @@ -176,7 +176,6 @@ For even more useful scripts, check out the [mpv User Scripts Wiki](https://gith
## History

- [Samillion/ModernZ](https://github.com/Samillion/ModernZ)
- forked from [zydezu/ModernX](https://github.com/zydezu/ModernX)
- forked from [dexeonify/ModernX](https://github.com/dexeonify/mpv-config/blob/main/scripts/modernx.lua)
- forked from [cyl0/ModernX](https://github.com/cyl0/ModernX)
- forked from [maoiscat/mpv-osc-modern](https://github.com/maoiscat/mpv-osc-modern)
Expand All @@ -188,6 +187,7 @@ For even more useful scripts, check out the [mpv User Scripts Wiki](https://gith
- To add a dedicated layout for images. [[details](/docs/IMAGE_VIEWER.md)]
- To re-do the project entirely to match mpv's stock osc standards, to ensure compatibility
- To eliminate old bugs and redundancy within the code
- Which allows other `Modern` forks to use ModernZ as a base, such as [zydezu/ModernX](https://github.com/zydezu/ModernX). [[Reference](https://github.com/zydezu/ModernX/releases/tag/0.3.9)]

In essence, to modernize and revive the `Modern` origin.

Expand Down
17 changes: 6 additions & 11 deletions docs/CONTROLS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ModernZ Controls Guide

![modernz-osc_buttons](https://github.com/user-attachments/assets/78918891-5442-43dc-b0be-072806b5fd66)
![modernz_osc_controls](https://github.com/user-attachments/assets/deb52cf2-8288-4f40-9993-9b7cb3e863e0)

## Button Interactions

Expand All @@ -25,17 +25,12 @@ Below is a list that explains the OSC buttons function depending on how you inte
| Right mouse click | Seek to the head of chosen chapter |
| Scroll wheel | Seek forward/backwards |

### Playback Time
### Play Time Codes

| Action | Function |
| ---------------- | ---------------------------- |
| Left mouse click | Display time in milliseconds |

### Duration

| Action | Function |
| ---------------- | -------------------------------------------- |
| Left mouse click | Display remaining time instead of total time |
| Action | Function |
| ----------------- | -------------------------------------------- |
| Left mouse click | Display remaining time instead of total time |
| Right mouse click | Display time in milliseconds |

### Play/Pause

Expand Down
2 changes: 1 addition & 1 deletion docs/INTERACTIVE_MENUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ModernZ integrates mpv's [console.lua](https://github.com/mpv-player/mpv/blob/ma

For details on how to interact with these buttons, view the [controls manual](/docs/CONTROLS.md).

https://github.com/user-attachments/assets/aa7305f3-9f14-4609-9d3e-95e18f003593
https://github.com/user-attachments/assets/7f6aeaec-4057-4099-a63c-42cf2e0ab3bb

> [!TIP]
> If the font size for the interactive playlist is too small, you can add the following in your `mpv.conf`
Expand Down
22 changes: 11 additions & 11 deletions docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| fadeduration | 250 | fade-out duration (in ms), set to `"0"` for no fade |
| minmousemove | 0 | minimum mouse movement (in pixels) required to show OSC |
| bottomhover | yes | show OSC only when hovering at the bottom |
| bottomhover_zone | 160 | height of hover zone for bottomhover (in pixels) |
| bottomhover_zone | 130 | height of hover zone for bottomhover (in pixels) |
| osc_on_seek | no | show OSC when seeking |
| mouse_seek_pause | yes | pause video while seeking with mouse move (on button hold) |
| vidscale | auto | scale osc with the video. (set to `"no"` to disable) |
Expand All @@ -47,13 +47,13 @@ Create `modernz.conf` in your mpv script-opts directory:
| show_title | yes | show title in the OSC (above seekbar) |
| title | `${media-title}` | title above seekbar format: `"${media-title}"` or `"${filename}"` |
| title_font_size | 30 | font size of the title text (above seekbar) |
| show_chapter_title | yes | show chapter title alongside timestamp (below seekbar) |
| show_chapter_title | yes | show chapter title (above seekbar) |
| chapter_fmt | %s | format for chapter display on seekbar hover (set to `"no"` to disable) |
| timetotal | yes | show total time instead of remaining time |
| timems | no | show timecodes with milliseconds |
| unicodeminus | no | use the Unicode minus sign in remaining time |
| time_format | dynamic | `"dynamic"` or `"fixed"`. shows MM:SS when possible, fixed always shows HH:MM:SS |
| time_font_size | 18 | font size of the time display |
| time_font_size | 16 | font size of the time display |

### Title bar settings

Expand All @@ -69,7 +69,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| Option | Value | Description |
| --------------------- | ----- | ---------------------------------------------------------------------- |
| raise_subtitles | yes | raise subtitles above the OSC when shown |
| raise_subtitle_amount | 165 | amount by which subtitles are raised when the OSC is shown (in pixels) |
| raise_subtitle_amount | 125 | amount by which subtitles are raised when the OSC is shown (in pixels) |

### Buttons display and functionality

Expand All @@ -86,7 +86,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| track_nextprev_buttons | yes | show next/previous playlist track buttons |
| volume_control | yes | show mute button and volume slider |
| volume_control_type | linear | volume scale type: `"linear"` or `"logarithmic"` |
| playlist_button | no | show playlist button: Left-click for simple playlist, Right-click for interactive playlist |
| playlist_button | yes | show playlist button: Left-click for simple playlist, Right-click for interactive playlist |
| hide_empty_playlist_button | yes | hide playlist button when no playlist exists |
| gray_empty_playlist_button | yes | gray out the playlist button when no playlist exists |
| download_button | yes | show download button on web videos (requires yt-dlp and ffmpeg) |
Expand All @@ -97,9 +97,9 @@ Create `modernz.conf` in your mpv script-opts directory:
| loop_button | no | show `loop` button |
| speed_button | no | show speed control button |
| loop_in_pause | yes | enable looping by right-clicking pause |
| info_button | no | show `info (stats)` button |
| info_button | yes | show `info (stats)` button |
| fullscreen_button | yes | show `fullscreen toggle` button |
| playpause_size | 30 | icon size for the play/pause button |
| playpause_size | 28 | icon size for the play/pause button |
| midbuttons_size | 24 | icon size for the middle buttons |
| sidebuttons_size | 24 | icon size for the side buttons |
| zoom_control | yes | show zoom controls in image viewer mode |
Expand All @@ -122,14 +122,14 @@ Create `modernz.conf` in your mpv script-opts directory:
| seekbar_cache_color | `#918F8E` | color of the cache ranges on the seekbar |
| volumebar_match_seek_color | no | match volume bar color with seekbar color (ignores `side_buttons_color`) |
| time_color | `#FFFFFF` | color of the timestamps (below seekbar) |
| chapter_title_color | `#FFFFFF` | color of the chapter title next to timestamp (below seekbar) |
| chapter_title_color | `#FFFFFF` | color of the chapter title (above seekbar) |
| side_buttons_color | `#FFFFFF` | color of the side buttons (audio, subtitles, playlist, etc.) |
| middle_buttons_color | `#FFFFFF` | color of the middle buttons (skip, jump, chapter, etc.) |
| playpause_color | `#FFFFFF` | color of the play/pause button |
| held_element_color | `#999999` | color of the element when held down (pressed) |
| hover_effect_color | `#FFFFFF` | color of a hovered button when `hover_effect` includes `"color"` |
| thumbnail_border_color | `#111111` | color of the border for thumbnails (with thumbfast) |
| fade_alpha | 150 | alpha of the OSC background box |
| fade_alpha | 130 | alpha of the OSC background box |
| fade_blur_strength | 100 | blur strength for the OSC alpha fade. caution: high values can take a lot of CPU time to render |
| window_fade_alpha | 75 | alpha of the window title bar |
| thumbnail_border | 2 | width of the thumbnail border (for thumbfast) |
Expand Down Expand Up @@ -187,8 +187,8 @@ Customize the button function based on mouse actions.
| | playlist_mbtn_right_command | `show-text ${playlist} 3000` |
| Volume Control | vol_ctrl_mbtn_left_command | `no-osd cycle mute` |
| | vol_ctrl_mbtn_right_command | `script-binding select/select-audio-device; script-message-to modernz osc-hide` |
| | vol_ctrl_wheel_down_command | `add volume -5` |
| | vol_ctrl_wheel_up_command | `add volume 5` |
| | vol_ctrl_wheel_down_command | `no-osd add volume -5` |
| | vol_ctrl_wheel_up_command | `no-osd add volume 5` |
| Audio Button | audio_track_mbtn_left_command | `script-binding select/select-aid; script-message-to modernz osc-hide` |
| | audio_track_mbtn_mid_command | `cycle audio down` |
| | audio_track_mbtn_right_command | `cycle audio` |
Expand Down
20 changes: 10 additions & 10 deletions modernz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ minmousemove=0
# show OSC only when hovering at the bottom
bottomhover=yes
# height of hover zone for bottomhover (in pixels)
bottomhover_zone=160
bottomhover_zone=130
# show OSC when seeking
osc_on_seek=no
# pause video while seeking with mouse move (on button hold)
Expand Down Expand Up @@ -72,7 +72,7 @@ unicodeminus=no
# "dynamic" or "fixed". dynamic shows MM:SS when possible, fixed always shows HH:MM:SS
time_format=dynamic
# font size of the time display
time_font_size=18
time_font_size=16

# Title bar settings
# show window title in borderless/fullscreen mode
Expand All @@ -88,7 +88,7 @@ windowcontrols_title=${media-title}
# raise subtitles above the OSC when shown
raise_subtitles=yes
# amount by which subtitles are raised when the OSC is shown (in pixels)
raise_subtitle_amount=165
raise_subtitle_amount=125

# Buttons display and functionality
# show the jump backward and forward buttons
Expand All @@ -115,7 +115,7 @@ volume_control=yes
# volume scale type: "linear" or "logarithmic"
volume_control_type=linear
# show playlist button: Left-click for simple playlist, Right-click for interactive playlist
playlist_button=no
playlist_button=yes
# hide playlist button when no playlist exists
hide_empty_playlist_button=yes
# gray out the playlist button when no playlist exists
Expand All @@ -137,15 +137,15 @@ loop_button=no
# show speed control button
speed_button=no
# show info button
info_button=no
info_button=yes
# show fullscreen toggle button
fullscreen_button=yes

# enable looping by right-clicking pause
loop_in_pause=yes

# icon size for the play/pause button
playpause_size=30
playpause_size=28
# icon size for the middle buttons
midbuttons_size=24
# icon size for the side buttons
Expand Down Expand Up @@ -199,7 +199,7 @@ hover_effect_color=#FFFFFF
thumbnail_border_color=#111111

# alpha of the OSC background box
fade_alpha=150
fade_alpha=130
# blur strength for the OSC alpha fade. caution: high values can take a lot of CPU time to render
fade_blur_strength=100
# alpha of the window title bar
Expand Down Expand Up @@ -272,8 +272,8 @@ playlist_mbtn_right_command=show-text ${playlist} 3000
# volume mouse actions
vol_ctrl_mbtn_left_command=no-osd cycle mute
vol_ctrl_mbtn_right_command=script-binding select/select-audio-device; script-message-to modernz osc-hide
vol_ctrl_wheel_down_command=add volume -5
vol_ctrl_wheel_up_command=add volume 5
vol_ctrl_wheel_down_command=no-osd add volume -5
vol_ctrl_wheel_up_command=no-osd add volume 5

# audio button mouse actions
audio_track_mbtn_left_command=script-binding select/select-aid; script-message-to modernz osc-hide
Expand Down Expand Up @@ -313,4 +313,4 @@ playlist_next_mbtn_right_command=script-binding select/select-playlist; script-m

# fullscreen button mouse actions
fullscreen_mbtn_left_command=cycle fullscreen
fullscreen_mbtn_right_command=cycle window-maximized
fullscreen_mbtn_right_command=cycle window-maximized
Loading