From 40396359bc0b3e9d30780f6de625880404bba2c4 Mon Sep 17 00:00:00 2001 From: diviocity Date: Sun, 8 Nov 2026 02:09:18 +0100 Subject: [PATCH] change default theme --- AGENTS.md | 12 +++++----- libvendetta/lib.v | 25 ++++++++++---------- src/main.v | 2 +- src/theme.v | 58 +++++++++++++++++++++++++---------------------- 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 348ad1f..821e40d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -374,7 +374,7 @@ render pump, the relay, the control bar geometry and its build). ### 6.1 Public surface -- `Palette` — the strip colours, all defaulting to the vinix-dark constants; +- `Palette` — the strip colours, all defaulting to the vendetta constants; a host can restyle the widget wholesale by assigning `Player.palette`, and `bg_docked` styles the static docked strip separately from the floating one (which keeps `bg_dark`). @@ -1126,8 +1126,8 @@ mpv defaults, which themes can restyle via `apply_mpv_colors`'s Theme files are `~/.config/vendetta/themes/.toml` with a single `[colors]` table; every value accepts `0x...`, `#...` or a bare hex string (`theme_color`) and anything missing/malformed keeps the built-in -vinix-dark value (a file of the default's name merely overlays it). The -available list is always `[vinix-dark, ...sorted files]`. +vendetta value (a file of the default's name merely overlays it). The +available list is always `[vendetta, ...sorted files]`. `set_theme` swaps `theme` + widget `palette` + the nine `ui2.set_menu_bar_*` globals + the mpv colours — the same composer live edits reuse. @@ -1146,7 +1146,7 @@ palette, menus, mpv colours — the whole window previews while you drag). `overlay_opacity` is the one non-colour value: the editor's slider sets it, and it fills the panels over the video (dialogs, settings, statistics, the seek preview). The scrims stay 0.45. Files carry it as `[opacity] overlay`, and a -file without it keeps 0.8. +file without it keeps the built-in 0.85 (the vendetta theme's value). Save writes the current values as a fresh `[colors]` TOML under the edited name, validates like every other name field, and makes it current. @@ -1438,8 +1438,8 @@ A theme file sample: ```toml [colors] -bg_dark = 0x020617 -btn_primary = 0x3b82f6 +bg_dark = 0x000000 +btn_primary = 0x2775f1 ... ``` diff --git a/libvendetta/lib.v b/libvendetta/lib.v index 94daa5e..cbb3a0a 100644 --- a/libvendetta/lib.v +++ b/libvendetta/lib.v @@ -25,16 +25,18 @@ import ui2 import wake import x.progress -// The vinix-dark palette vendetta compiles in, so the widget reads like the +// The vendetta palette vendetta compiles in, so the widget reads like the // standalone player without a theme file system behind it. -const slider_track_dark = 0x334155 -const slider_value_blue = 0x3b82f6 -const btn_blue = 0x3b82f6 -const btn_secondary_slate = 0x64748b +const slider_track_dark = 0x091029 +const slider_value_blue = 0x2775f1 +const btn_blue = 0x2775f1 +const btn_secondary_slate = 0x06061d const text_main_white = u32(0xffffff) const text_muted_slate = 0xe2e8f0 -const bg_dark_night = 0x020617 -const bg_surface_slate = 0x1e293b +const bg_dark_night = 0x000000 +const bg_surface_slate = 0x000000 +const btn_seek_dark = 0x06061d +const btn_mute_dark = 0x000000 // smooth_glide_cap bounds how far the smooth bar's glide may run ahead of the // last reported position, in seconds: a decoder that stalls its reports stops @@ -50,12 +52,11 @@ pub mut: btn_primary u32 = btn_blue btn_secondary u32 = btn_secondary_slate // The control strip's buttons: the play/pause toggle, the seek steps and - // the mute toggle. They default to the strip's backdrop, so the glyphs - // sit on the bar without boxes of their own; each keeps a field so a - // host can split them apart again. + // the mute toggle. Each keeps a field so a host can give it its own box; + // the defaults are the vendetta theme's strip. btn_play u32 = btn_blue - btn_seek u32 = bg_dark_night - btn_mute u32 = bg_dark_night + btn_seek u32 = btn_seek_dark + btn_mute u32 = btn_mute_dark text_main u32 = text_main_white text_muted u32 = text_muted_slate bg_dark u32 = bg_dark_night diff --git a/src/main.v b/src/main.v index ecd891d..aeca08e 100644 --- a/src/main.v +++ b/src/main.v @@ -61,7 +61,7 @@ examples: // file list. struct Config { show_help bool @[long: help; short: h; xdoc: 'Show this help text and exit'] - theme string @[xdoc: 'Theme file, without .toml, from ~/.config/vendetta/themes (default: the saved theme, else vinix-dark)'] + theme string @[xdoc: 'Theme file, without .toml, from ~/.config/vendetta/themes (default: the saved theme, else vendetta)'] volume f64 = -1 @[xdoc: 'Initial volume, 0 to 100 (default: the saved volume)'] mute bool @[xdoc: 'Start muted'] speed f64 = -1 @[xdoc: 'Playback speed, 0.01 to 100 (default: the saved speed)'] diff --git a/src/theme.v b/src/theme.v index b482baf..35901b8 100644 --- a/src/theme.v +++ b/src/theme.v @@ -8,41 +8,44 @@ import libvendetta.mpv // default_theme_name is the built-in theme. It is always offered, even with no // theme files, and a theme file of the same name only overlays its colours. -const default_theme_name = 'vinix-dark' +const default_theme_name = 'vendetta' -// The built-in colour palette, the values the vinix-dark theme writes out. -const slider_track_dark = 0x334155 -const slider_value_blue = 0x3b82f6 +// The built-in colour palette, the values the vendetta theme writes out. +const slider_track_dark = 0x091029 +const slider_value_blue = 0x2775f1 -const btn_blue = 0x3b82f6 // ui2 primary (buttons, value track) -const btn_secondary = 0x64748b // ui2 muted slate (seek buttons) +const btn_blue = 0x2775f1 // ui2 primary (buttons, value track) +const btn_secondary = 0x06061d // near-black secondary (seek buttons) // The control strip's buttons: the play/pause toggle, the seek steps and the -// mute toggle. They default to the strip's own backdrop (bg_dark), so the -// glyphs sit on the bar without boxes of their own; each keeps a key so a -// theme can split them apart again. +// mute toggle. Each keeps a key so a theme can give it its own box; the +// defaults are the vendetta theme's strip. const btn_play = btn_blue -const btn_seek = bg_dark -const btn_mute = bg_dark +const btn_seek = 0x06061d +const btn_mute = 0x000000 const text_main = u32(0xffffff) // pure white (labels, button glyphs) const text_muted = 0xe2e8f0 // very light slate (stats body, time labels) -const bg_dark = 0x020617 // near-black media control bg -const bg_surface = 0x1e293b // ui2 surface (dialogs, overlay, preview popup) +const bg_dark = 0x000000 // near-black media control bg +const bg_surface = 0x000000 // ui2 surface (dialogs, overlay, preview popup) // The menu bar's colours: the bar strip, its underline and the open panels' // outline, the titles and row labels, the disabled rows and the shortcuts // beside them, the hover and open highlight, and the open panel's background, // shadow and separators. ui2 ships a light bar for hosts that want one; -// vinix-dark overrides all nine so the bar sits in the dark chrome with it. -const menu_bg = u32(0x1e293b) -const menu_border = u32(0x334155) -const menu_text = u32(0xe2e8f0) -const menu_disabled = u32(0x64748b) -const menu_shortcut = u32(0x94a3b8) -const menu_highlight = u32(0x334155) -const menu_panel = u32(0x1e293b) -const menu_shadow = u32(0x020617) -const menu_separator = u32(0x334155) +// vendetta overrides all nine so the bar sits in the black chrome with it. +const menu_bg = u32(0x000000) +const menu_border = u32(0x000000) +const menu_text = u32(0xbbbbbb) +const menu_disabled = u32(0x3e3e3e) +const menu_shortcut = u32(0x958c83) +const menu_highlight = u32(0x2775f1) +const menu_panel = u32(0x000000) +const menu_shadow = u32(0x000000) +const menu_separator = u32(0x000000) + +// How much of the video the floating panels hide, the vendetta theme's value; +// a theme file without an [opacity] table keeps it. +const default_overlay_opacity = 0.85 // The text fields' backdrop and the dialog scrim, plus the OSD and subtitle // colours mpv draws over the video. The first two keep the values the views @@ -56,7 +59,7 @@ const sub_text = u32(0xffffff) const sub_border = u32(0x000000) // Theme is every colour the window paints. A theme file can replace any of -// them; whatever it leaves out keeps the built-in vinix-dark values. +// them; whatever it leaves out keeps the built-in vendetta values. struct Theme { mut: slider_track u32 @@ -98,8 +101,9 @@ mut: sub_text u32 sub_border u32 // How much of the video the panels floating over it hide, 0 to 1: dialogs, - // settings, the statistics popup and the seek preview. - overlay_opacity f64 = 0.8 + // settings, the statistics popup and the seek preview. The default is the + // vendetta theme's value. + overlay_opacity f64 = default_overlay_opacity } // default_theme is the theme that is compiled into vendetta. @@ -146,7 +150,7 @@ fn theme_dir() string { } // theme_color reads one colour out of a theme table. It accepts a TOML -// integer (0x334155) or a string ('334155', '#334155', '0x334155'); anything +// integer (0x091029) or a string ('091029', '#091029', '0x091029'); anything // else, or a missing key, keeps the fallback value. fn theme_color(table toml.Any, key string, fallback u32) u32 { val := table.value_opt(key) or { return fallback } -- 2.56.1