Skip to content
Open
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
11 changes: 6 additions & 5 deletions docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ Create `modernz.conf` in your mpv script-opts directory:

### Title bar settings

| Option | Value | Description |
| -------------------- | ---------------- | ------------------------------------------------------------------------- |
| window_title | no | show window title in borderless/fullscreen mode |
| window_controls | yes | show window controls (close, minimize, maximize) in borderless/fullscreen |
| windowcontrols_title | `${media-title}` | same as title but for window_top_bar |
| Option | Value | Description |
| ----------------------- | ---------------- | ------------------------------------------------------------------------- |
| show_window_title | no | show window title in borderless/fullscreen mode |
| window_title | `${media-title}` | same as title but for window_top_bar |
| window_title_font_size | 26 | window title font size |
| window_controls | yes | show window controls (close, minimize, maximize) in borderless/fullscreen |

### Subtitle display settings

Expand Down
8 changes: 5 additions & 3 deletions modernz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ tooltip_font_size=14

# Title bar settings
# show window title in borderless/fullscreen mode
window_title=no
show_window_title=no
# same as title but for window_top_bar
window_title=${media-title}
# window title font size
window_title_font_size=26
# show window controls (close, minimize, maximize) in borderless/fullscreen
window_controls=yes
# same as title but for window_top_bar
windowcontrols_title=${media-title}

# Subtitle display settings
# raise subtitles above the OSC when shown
Expand Down
21 changes: 11 additions & 10 deletions modernz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ local user_opts = {
tooltip_font_size = 14, -- tooltips font size

-- Title bar settings
window_title = false, -- show window title in borderless/fullscreen mode
show_window_title = false, -- show window title in borderless/fullscreen mode
window_title = "${media-title}", -- same as title but for window_top_bar
window_title_font_size = 26, -- window title font size
window_controls = true, -- show window controls (close, minimize, maximize) in borderless/fullscreen
windowcontrols_title = "${media-title}", -- same as title but for windowcontrols

-- Subtitle display settings
raise_subtitles = true, -- raise subtitles above the OSC when shown
Expand All @@ -93,8 +94,8 @@ local user_opts = {
volume_control = true, -- show mute button and volume slider
volume_control_type = "linear", -- volume scale type: "linear" or "logarithmic"
playlist_button = true, -- show playlist button: Left-click for simple playlist, Right-click for interactive playlist
hide_empty_playlist_button = false, -- hide playlist button when no playlist exists
gray_empty_playlist_button = false, -- gray out the playlist button when no playlist exists
hide_empty_playlist_button = false, -- hide playlist button when no playlist exists
gray_empty_playlist_button = false, -- gray out the playlist button when no playlist exists

fullscreen_button = true, -- show fullscreen toggle button
info_button = true, -- show info button
Expand Down Expand Up @@ -515,7 +516,7 @@ local function set_osc_styles()
osc_fade_bg = "{\\blur" .. user_opts.fade_blur_strength .. "\\bord" .. user_opts.fade_alpha .. "\\1c&H0&\\3c&H" .. osc_color_convert(user_opts.osc_color) .. "&}",
window_fade_bg = "{\\blur" .. user_opts.window_fade_blur_strength .. "\\bord" .. user_opts.window_fade_alpha .. "\\1c&H0&\\3c&H" .. osc_color_convert(user_opts.osc_color) .. "&}",
window_control = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.window_controls_color) .. "&\\3c&H0&\\fs25\\fn" .. iconfont .. "}",
window_title = "{\\blur1\\bord0.5\\1c&H" .. osc_color_convert(user_opts.window_title_color) .. "&\\3c&H0&\\fs26\\q2\\fn" .. user_opts.font .. "}",
window_title = "{\\blur1\\bord0.5\\1c&H" .. osc_color_convert(user_opts.window_title_color) .. "&\\3c&H0&\\fs".. user_opts.window_title_font_size .."\\q2\\fn" .. user_opts.font .. "}",
title = "{\\blur1\\bord0.5\\1c&H" .. osc_color_convert(user_opts.title_color) .. "&\\3c&H0&\\fs".. user_opts.title_font_size .."\\q2\\fn" .. user_opts.font .. "}",
chapter_title = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.chapter_title_color) .. "&\\3c&H0&\\fs" .. user_opts.chapter_title_font_size .. "\\fn" .. user_opts.font .. "}",
seekbar_bg = "{\\blur0\\bord0\\1c&H" .. osc_color_convert(user_opts.seekbarbg_color) .. "&}",
Expand Down Expand Up @@ -1680,7 +1681,7 @@ local function window_controls()
end

-- Window Title
if user_opts.window_title then
if user_opts.show_window_title then
lo = add_layout("windowtitle")
lo.geometry = {x = 20, y = button_y + 14, an = 1, w = osc_param.playresx - 50, h = wc_geo.h}
lo.style = string.format("%s{\\clip(%f,%f,%f,%f)}", osc_styles.window_title, titlebox_left, wc_geo.y - wc_geo.h, titlebox_right, wc_geo.y + wc_geo.h)
Expand Down Expand Up @@ -1743,7 +1744,7 @@ layouts["modern"] = function ()
lo.layer = 10
lo.alpha[3] = user_opts.fade_transparency_strength

local top_titlebar = window_controls_enabled() and (user_opts.window_title or user_opts.window_controls)
local top_titlebar = window_controls_enabled() and (user_opts.show_window_title or user_opts.window_controls)

-- Window bar alpha
if ((user_opts.window_top_bar == "yes" or not (state.border and state.title_bar)) or state.fullscreen) and top_titlebar then
Expand Down Expand Up @@ -2039,7 +2040,7 @@ layouts["modern-image"] = function ()
lo.layer = 10
lo.alpha[3] = user_opts.fade_transparency_strength

local top_titlebar = window_controls_enabled() and (user_opts.window_title or user_opts.window_controls)
local top_titlebar = window_controls_enabled() and (user_opts.show_window_title or user_opts.window_controls)

-- Window bar alpha
if ((user_opts.window_top_bar == "yes" or not (state.border and state.title_bar)) or state.fullscreen) and top_titlebar then
Expand Down Expand Up @@ -2274,7 +2275,7 @@ local function osc_init()
-- Window Title
ne = new_element("windowtitle", "button")
ne.content = function ()
local title = mp.command_native({"expand-text", user_opts.windowcontrols_title}) or ""
local title = mp.command_native({"expand-text", user_opts.window_title}) or ""
title = title:gsub("\n", " ")
return title ~= "" and mp.command_native({"escape-ass", title}) or "mpv"
end
Expand Down Expand Up @@ -3096,7 +3097,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)
local top_hover = window_controls_enabled() and (user_opts.window_title or user_opts.window_controls)
local top_hover = window_controls_enabled() and (user_opts.show_window_title or user_opts.window_controls)
if mouseY > osc_param.playresy - (user_opts.bottomhover_zone or 130)
or ((user_opts.window_top_bar == "yes" or not (state.border and state.title_bar)) or state.fullscreen) and (mouseY < 40 and top_hover) then
show_osc()
Expand Down