move icons to svg (optional), adjust slider bar height
@@ -136,6 +136,7 @@ Debug flags, each compiled only behind `$if <flag>?`:
136136| `-d playback_probe` | a worker prints mpv's pacing/counters per second during playback (decoder/display drops, presents, repeat skips, mistimed/vo-delayed deltas, sync mode, hwdec, fps, position) to pin a choppy file to a pipeline stage |
137137| `-d debug_cadence` | one-line stderr trace at the interesting points: keys, pointer moves, property changes, pause flips, queue moves, file end |
138138| `-d mpv_noflip` | disables the `flip_y` render param override (`flip_on_android` exists to flip for Android's bottom-up convention; the define is the opt-out) |
139+| `-d no_png_icons` | compiles the assets/icons resolution out so the strip's buttons draw the compiled-in Material glyphs alone (see §6.8); useful for builds that ship no assets tree |
139140
140141---
141142
@@ -377,7 +378,9 @@ render pump, the relay, the control bar geometry and its build).
377378 and `bg_docked` styles the static docked strip separately from the floating
378379 one (which keeps `bg_dark`).
379380- `Config` — `overlay` (floating strip over full-height video vs docked band
380- below), `seek_step` (30 s), `volume_step` (5), `block_target_time` (mpv's
381+ below), `seek_step` (30 s), `volume_step` (5), `slider_h` (the seek and volume
382+ tracks' shared height, 10 by default, kept within 1..30),
383+ `block_target_time` (mpv's
381384 default presentation pacing), `input_scope` (`.frame` — only input inside
382385 the widget's frame, keys follow the pointer — or `.window`), `ao` (audio
383386 server name, 'auto', or empty), plus three hooks:
@@ -411,9 +414,11 @@ render pump, the relay, the control bar geometry and its build).
411414
412415`new(cfg)`/`setup(cfg)`:
413416
414-1. (Android) registers the JavaVM with libavcodec.
415-2. `mpv.create()`.
416-3. Sets `vo=libmpv` (hands mpv's output to the render API instead of a
417+1. Resolves the strip's icons into `p.icon_files` (`resolve_strip_icons`,
418+ §6.8) before any build reads them; everything below is mpv's setup.
419+2. (Android) registers the JavaVM with libavcodec.
420+3. `mpv.create()`.
421+4. Sets `vo=libmpv` (hands mpv's output to the render API instead of a
417422 window of its own),
418423 the audio output, `keep-open=yes`, and — because display sync cannot
419424 measure the vsync rate with the libmpv video output —
@@ -423,10 +428,10 @@ render pump, the relay, the control bar geometry and its build).
423428 (mpv's own autoprobing), other names pass through; on Android the same
424429 default is `audiotrack`; on other platforms only an explicit non-auto
425430 name is written.
426-4. Log level 'warn' ('v' under `-d video_debug`; the shader chain logs
431+5. Log level 'warn' ('v' under `-d video_debug`; the shader chain logs
427432 reconfigures, pass compilation and GL errors at info/verbose which warn
428433 would swallow).
429-5. Calls the `pre_init` hook (this is where the standalone app seeds
434+6. Calls the `pre_init` hook (this is where the standalone app seeds
430435 `--mpv-opt`s and the display-fps override), `mpv.initialize`, then
431436 observes its nine properties (§6.4).
432437
@@ -649,7 +654,10 @@ time columns (down to a floor computed from the short-label saving;
649654and hh:mm:ss from then on). The volume column's width mirrors the button
650655cluster's exactly so the seek slider sits at the strip's centre.
651656
652-Sliders are drawn bare (`thumb_size: seek_thumb_hidden = -1`). The seek
657+Sliders are drawn bare (`thumb_size: seek_thumb_hidden = -1`), and their
658+visible height is the style's `track_width`, set from `Config.slider_h`, not
659+the rect's height: `slider_frame` only grows the rect around a track taller
660+than the row, so the whole track takes input. The seek
653661slider's seed value is `p.glide_pos()`, **not** the raw reported position: a
654662rebuild can land between reports, and seeding with the report would snap the
655663thumb back. `glide_pos()` — the smooth bar — extrapolates the last reported
@@ -662,9 +670,21 @@ the chain's next link, the scheduler coalesces it with the slider write's
662670own ask, and the chain dies (on pause, hidden strip, or the option off) by
663671simply not asking.
664672
665-Buttons are `glyph_button`s: ui2 buttons whose `image_path` is a `'symbol:'
666-` glyph (`symbol:play.fill`, `symbol:gobackward.30`, ...), tinted by the
667-button's text style.
673+Buttons are `glyph_button`s: ui2 buttons whose `image_path` is the icon the
674+strip's role resolves to (`p.strip_icon(name)`). The icons are the rastered
675+set under `assets/icons/` — Google's filled Material exports, rendered at
676+64 px and colorized to the palette colours by `scripts/make_pngs.sh` from
677+the SVG sources in `scripts/icons/`
678+(ImageMagick for now; **stb_image**, what ui2 draws button images through,
679+cannot parse SVG) — found one of three places: `assets/icons` beside the
680+executable (the release layout), in the module tree the build came from, in
681+the working directory; resolved once in `setup` into `p.icon_files`. A
682+rastered image draws as it is, so a theme cannot tint it the way a glyph is
683+tinted by the button's text style. Where no bundle is found — an Android
684+run, a host that ships no assets — and for builds compiled with
685+`-d no_png_icons`, the roles fall back to the compiled-in `'symbol:'`
686+Material glyphs (`symbol:play.fill`, `symbol:gobackward.30`, ...), which
687+tint by the text style instead.
668688
669689### 6.9 What a host owes the widget
670690
@@ -760,7 +780,8 @@ Flags (every one documented above; the value-form `--mpv-opt name=value` may
760780repeat): `--help/-h`, `--theme`, `--volume`, `--mute`, `--speed`, `--fullscreen`,
761781`--overlay/--no-overlay`, `--loop/--loop-playlist`, `--hwdec/--no-hwdec`,
762782`--deinterlace`, `--low-quality`, `--preview/--no-preview`,
763-`--smooth-bar/--no-smooth-bar`, `--media-controls/--no-media-controls`,
783+`--smooth-bar/--no-smooth-bar`, `--slider-height`,
784+`--media-controls/--no-media-controls`,
764785`--ao`, `--display-fps` (for `display-fps-override` on multi-monitor/Wayland
765786setups where detection cannot know the screen), `--no-block-target-time`,
766787`--start-at` (seconds or mm:ss), `--sub-file`, `--mpv-opt`, trailing files.
@@ -1040,7 +1061,7 @@ pass and the audio-server/output-device writes do. Results arrive on
10401061max_volume, muted, speed, ao, loop_file, loop_playlist, hwdec, deinterlace,
10411062ui_scale, sub_visible, aspect, rotate, zoom, windowed_overlay,
10421063fullscreen_overlay, show_stats, show_queue, show_preview, open_mode,
1043-low_quality, continuous, smooth_bar, theme, preset, media_controls,
1064+low_quality, continuous, smooth_bar, slider_height, theme, preset, media_controls,
10441065mpv_opts. Written a second after the last `settings_changed()` (debounced)
10451066and once more after the window closes; `save_settings` skips the write when
10461067the file already holds the same text, so a key that saves nothing costs an
@@ -1344,6 +1365,24 @@ Icons is the front of the portable-symbol fallback chain, Noto Sans Symbols 2
13441365covers the marks an interface labels rows with and follows one
13451366machine-installed symbol face for the blocks it misses.
13461367
1368+`assets/icons/` — the control strip's icons: the PNGs the widget's buttons
1369+actually draw, and nothing else (`assets/` ships everywhere — CI zips it
1370+beside the binary and vab packages it into the APK whole). The SVG sources
1371+live in `scripts/icons/`, Google's filled
1372+exports (`*_24dp_E3E3E3_FILL1_wght400_GRAD0_opsz24.svg`, fair license), and
1373+are rendered by `scripts/make_pngs.sh` — ImageMagick (for now) renders the
1374+24 px viewBox straight at 64 px and colorizes each raster to the palette
1375+colour its role draws with (`text_main`, `#ffffff`, for every strip icon
1376+today), because the exports carry their own `#e3e3e3` fill. The script keys
1377+on the role table, not the export names: Google's names churn with every
1378+fill/weight change, and the prefix lookup follows along. The drawing names
1379+are the roles, not the export names: `play`, `pause`, `replay30`,
1380+`forward30`, `volume_up`, `volume_off`. `libvendetta/draw.v`'s
1381+`glyph_button` draws the PNGs where the bundle resolves (see §6.8 for the
1382+search order and the `-d no_png_icons` glyph-only build); `volume_mute.png`
1383+has no call site — it is the set's alternate mute glyph, generated alongside
1384+so the bundle stays whole.
1385+
13471386`libvendetta/mpv/win64/` — headers + an import library generated from the
13481387DLL's export table (recipe in its README) + a `.def` of the exported
13491388symbols; no runtime DLL (that ships beside the exe).
@@ -622,6 +622,9 @@ const bar_mute_w = 24.0
622622const bar_volume_w = bar_button_play_w + bar_button_seek_w * 2 + bar_gap * 2 - bar_mute_w - bar_gap
623623const bar_time_pad = 20.0
624624const bar_time_gap = 5.0
625+// The time labels sit this far below the row's centre: the font's digits ride
626+// high, so a centred label reads above the sliders beside it.
627+const bar_time_nudge = 1.0
625628const bar_seek_min_w = 60.0
626629const bar_volume_min_w = 40.0
627630const bar_time_min_w = 56.0
@@ -633,6 +636,15 @@ fn time_column_w(duration f64) f64 {
633636 return if duration >= 0 && duration < bar_time_hour { bar_time_short_w } else { bar_time_w }
634637}
635638
639+// slider_frame is a slider's rect for a track of height h: a track taller than
640+// the row grows the frame around its centre, so the whole track takes input.
641+fn slider_frame(row ui2.Rect, h f64) ui2.Rect {
642+ if h <= row.height {
643+ return row
644+ }
645+ return ui2.rect(row.x, row.y - (h - row.height) / 2, row.width, h)
646+}
647+
636648// A negative slider thumb_size draws no thumb; the bars are bare tracks.
637649const seek_thumb_hidden = -1.0
638650
@@ -662,7 +674,6 @@ pub:
662674// coordinates: seek back, play, seek forward, elapsed, seek slider, total,
663675// mute, volume. The seek slider takes the leftover width; in a narrow strip
664676// the volume slider shrinks first, then the time columns.
665-@[live]
666677pub fn control_bar(b ui2.Rect, duration f64) ControlBar {
667678 bar_y := b.height - bar_height
668679 mid := bar_y + bar_height / 2
@@ -694,9 +705,10 @@ pub fn control_bar(b ui2.Rect, duration f64) ControlBar {
694705 seek_back := ui2.rect(bar_pad, mid - bar_button / 2, bar_button_seek_w, bar_button)
695706 toggle := ui2.rect(seek_back.x + bar_button_seek_w + bar_gap, mid - bar_button / 2, bar_button_play_w, bar_button)
696707 seek_forward := ui2.rect(toggle.x + bar_button_play_w + bar_gap, mid - bar_button / 2, bar_button_seek_w, bar_button)
697- elapsed := ui2.rect(seek_forward.x + bar_button_seek_w + outer_gap, mid - bar_row / 2, time_w, bar_row)
708+ elapsed := ui2.rect(seek_forward.x + bar_button_seek_w + outer_gap, mid - bar_row / 2 + bar_time_nudge,
709+ time_w, bar_row)
698710 seek := ui2.rect(elapsed.x + time_w + bar_time_gap, mid - bar_row / 2, seek_w, bar_row)
699- total := ui2.rect(seek.x + seek_w + bar_time_gap, mid - bar_row / 2, time_w, bar_row)
711+ total := ui2.rect(seek.x + seek_w + bar_time_gap, mid - bar_row / 2 + bar_time_nudge, time_w, bar_row)
700712 mute := ui2.rect(total.x + time_w + outer_gap, mid - bar_row / 2, bar_mute_w, bar_row)
701713 volume := ui2.rect(mute.x + bar_mute_w + bar_gap, mid - bar_row / 2, volume_w, bar_row)
702714 return ControlBar{
@@ -764,6 +776,87 @@ pub fn (mut p Player) build(frame ui2.Rect) ui2.Element {
764776 return ui2.view(root_id, frame, ui2.BoxStyle{ transparent: true }, children)
765777}
766778
779+// The control strip's icons come from assets/icons: the Material Symbols the
780+// SVGs there export raster to PNGs at 64 px (stb_image, what ui2 draws button
781+// images through, cannot parse SVG). The keys are the roles the strip's
782+// buttons play, not the files' names, so an icon can change under them.
783+const strip_icon_names = ['play', 'pause', 'replay30', 'forward30', 'volume_up', 'volume_off']
784+
785+// strip_icon_glyph names the Material glyph each icon role falls back to: a
786+// build with no raster icons (`-d no_png_icons`) or a layout without the
787+// assets bundle draws these, rendered from the fonts on every platform —
788+// a missing PNG would otherwise come out as ui2's outline box.
789+fn strip_icon_glyph(name string) string {
790+ return match name {
791+ 'play' {
792+ 'symbol:play.fill'
793+ }
794+ 'pause' {
795+ 'symbol:pause.fill'
796+ }
797+ 'replay30' {
798+ 'symbol:gobackward.30'
799+ }
800+ 'forward30' {
801+ 'symbol:goforward.30'
802+ }
803+ 'volume_up' {
804+ 'symbol:speaker.wave.2.fill'
805+ }
806+ 'volume_off' {
807+ 'symbol:speaker.slash.fill'
808+ }
809+ else {
810+ ''
811+ }
812+ }
813+}
814+
815+// icon_bundle_dirs lists the places assets/icons ships: beside the executable
816+// (the release layout zips assets/ next to the binary), in the module tree the
817+// build came from, and the working directory. The first hit wins.
818+fn icon_bundle_dirs() []string {
819+ return [
820+ os.join_path(os.dir(os.executable()), 'assets', 'icons'),
821+ os.join_path(@VMODROOT, 'assets', 'icons'),
822+ os.join_path(os.getwd(), 'assets', 'icons'),
823+ ]
824+}
825+
826+// resolve_strip_icons maps the icon roles to what the strip's buttons draw:
827+// each bundled PNG's path, or '' where this layout has none (the buttons then
828+// fall to the glyphs). `-d no_png_icons` compiles the resolution out entirely,
829+// leaving the glyphs alone to carry the strip.
830+fn resolve_strip_icons() map[string]string {
831+ mut icons := map[string]string{}
832+ $if no_png_icons ? {
833+ return icons
834+ } $else {
835+ for name in strip_icon_names {
836+ icons[name] = ''
837+ for dir_path in icon_bundle_dirs() {
838+ bundle_path := os.join_path(dir_path, name + '.png')
839+ if os.is_file(bundle_path) {
840+ icons[name] = bundle_path
841+ break
842+ }
843+ }
844+ }
845+ return icons
846+ }
847+}
848+
849+// strip_icon is the string the button for `name` draws: the bundled PNG's
850+// path, or the Material glyph the old build carried when the role has none.
851+fn (p &Player) strip_icon(name string) string {
852+ if icon := p.icon_files[name] {
853+ if icon.len > 0 {
854+ return icon
855+ }
856+ }
857+ return strip_icon_glyph(name)
858+}
859+
767860// build_controls returns the control elements in the strip's coordinates.
768861// They are appended one at a time: the checker panics on array literals that
769862// mix many of these constructor calls.
@@ -790,18 +883,20 @@ fn build_controls(p &Player, bar ControlBar) []ui2.Element {
790883 ...label_text
791884 align: .right
792885 }
886+ // The seek and volume tracks share one height, kept inside the strip.
887+ slider_h := math.min(math.max(p.cfg.slider_h, 1.0), bar_height)
793888 mut children := []ui2.Element{}
794- children << glyph_button('vd_seek_back', bar.seek_back, button_box_seek, button_text, 'symbol:gobackward.30')
889+ children << glyph_button('vd_seek_back', bar.seek_back, button_box_seek, button_text, p.strip_icon('replay30'))
795890 children << glyph_button('vd_toggle', bar.toggle, button_box, button_text, if p.paused {
796- 'symbol:play.fill'
891+ p.strip_icon('play')
797892 } else {
798- 'symbol:pause.fill'
893+ p.strip_icon('pause')
799894 })
800- children << glyph_button('vd_seek_forward', bar.seek_forward, button_box_seek, button_text, 'symbol:goforward.30')
895+ children << glyph_button('vd_seek_forward', bar.seek_forward, button_box_seek, button_text, p.strip_icon('forward30'))
801896 children << ui2.label('vd_elapsed', fmt_time(p.pos), bar.elapsed, elapsed_text)
802897 children << ui2.slider(ui2.SliderConfig{
803898 id: 'vd_seek'
804- frame: bar.seek
899+ frame: slider_frame(bar.seek, slider_h)
805900 min: 0
806901 max: if p.duration > 0 { p.duration } else { 1.0 }
807902 // The glide's position, not the raw report: a rebuild lands between
@@ -813,14 +908,14 @@ fn build_controls(p &Player, bar ControlBar) []ui2.Element {
813908 style: ui2.SliderStyle{
814909 track_color: p.palette.slider_track
815910 value_track_color: p.palette.slider_value
816- track_width: 10.0
911+ track_width: slider_h
817912 thumb_size: seek_thumb_hidden
818913 }
819914 })
820915 children << ui2.label('vd_total', fmt_time(p.duration), bar.total, label_text)
821916 children << ui2.slider(ui2.SliderConfig{
822917 id: 'vd_volume'
823- frame: bar.volume
918+ frame: slider_frame(bar.volume, slider_h)
824919 min: 0
825920 max: 100
826921 value: p.volume
@@ -833,7 +928,7 @@ fn build_controls(p &Player, bar ControlBar) []ui2.Element {
833928 } else {
834929 p.palette.slider_value
835930 }
836- track_width: 10.0
931+ track_width: slider_h
837932 thumb_size: seek_thumb_hidden
838933 }
839934 })
@@ -841,16 +936,17 @@ fn build_controls(p &Player, bar ControlBar) []ui2.Element {
841936 bg: p.palette.btn_mute
842937 radius: 6
843938 opacity: 0.8
844- }, button_text, if p.muted { 'symbol:speaker.slash.fill' } else { 'symbol:speaker.wave.2.fill' })
939+ }, button_text, if p.muted { p.strip_icon('volume_off') } else { p.strip_icon('volume_up') })
845940 return children
846941}
847942
848-// glyph_button builds an image-only control button: the control line uses
849-// symbol glyphs instead of text, sized by the button's rect and tinted by its
850-// style.
851-fn glyph_button(id string, frame ui2.Rect, box_style ui2.BoxStyle, text_style ui2.TextStyle, symbol string) ui2.Element {
943+// glyph_button builds an image-only control button from the string the icon
944+// resolution hands it: a file path draws the rastered PNG as it is (no tint —
945+// a theme cannot restyle it), a 'symbol:' name draws the glyph tinted by the
946+// button's text style.
947+fn glyph_button(id string, frame ui2.Rect, box_style ui2.BoxStyle, text_style ui2.TextStyle, icon string) ui2.Element {
852948 return ui2.Element{
853949 ...ui2.button(id, '', frame, box_style, text_style)
854- image_path: symbol
950+ image_path: icon
855951 }
856952}
@@ -77,6 +77,9 @@ pub mut:
7777 seek_step f64 = 30
7878 // How far one wheel or arrow key step moves the volume.
7979 volume_step f64 = 5
80+ // The height of the seek and volume tracks, in layout pixels: 1 up to the
81+ // strip's 30. Read on every build.
82+ slider_h f64 = 10
8083 // Whether mpv's render call waits out each frame's target display time.
8184 // Disabling it trades presentation pacing for a snappier UI thread.
8285 block_target_time bool = true
@@ -178,6 +181,11 @@ mut:
178181 // relay spawns, released on destroy: two embedded players then wake only
179182 // their own relays instead of trading frame-rate asks.
180183 wake_slot int = -1
184+ // The strip's icon roles (play, pause, the seek steps, the volume states)
185+ // resolved once in setup: the bundled PNG's path under assets/icons, or ''
186+ // where the build carries none (`-d no_png_icons`, or no bundle on this
187+ // layout) and the glyph fallback takes over. Builds read this.
188+ icon_files map[string]string
181189}
182190
183191// Observed property ids. The widget tracks the playback properties its
@@ -283,6 +291,10 @@ pub fn new(cfg Config) &Player {
283291// larger struct than the widget. It mirrors the standalone player's options.
284292pub fn (mut p Player) setup(cfg Config) {
285293 p.cfg = cfg
294+ // The strip's icons resolve before any build reads them: a layout without
295+ // the assets bundle leaves the roles empty, and draw.v's glyphs carry the
296+ // buttons instead.
297+ p.icon_files = resolve_strip_icons()
286298 register_android_vm()
287299 p.mpv_ctx = mpv.create()
288300 if p.mpv_ctx == unsafe { nil } {
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M7.5,16V14.5H10v-1H8.5v-1H10v-1H7.5V10h3q0.43,0 0.71,0.29T11.5,11v4q0,0.42-0.29,0.71T10.5,16h-3Zm6,0q-0.42,0-0.71-0.29T12.5,15V11q0-0.43 0.29-0.71T13.5,10h2q0.43,0 0.71,0.29T16.5,11v4q0,0.42-0.29,0.71T15.5,16h-2ZM14,14.5h1v-3H14v3ZM8.49,21.29q-1.64-0.71-2.85-1.93T3.71,16.51T3,13T3.71,9.49T5.64,6.64T8.49,4.71T12,4h0.15L10.6,2.45L12,1l4,4L12,9L10.6,7.55L12.15,6H12Q9.08,6 7.04,8.04T5,13t2.04,4.96T12,20t4.96-2.04Q19,15.93 19,13h2q0,1.88-0.71,3.51t-1.93,2.85t-2.85,1.93T12,22T8.49,21.29Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M14,19V5h4V19H14ZM6,19V5h4V19H6Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M8,19V5l11,7L8,19Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M8.49,21.29q-1.64-0.71-2.85-1.93T3.71,16.51T3,13H5q0,2.92 2.04,4.96T12,20t4.96-2.04Q19,15.93 19,13q0-2.93-2.04-4.96T12,6H11.85L13.4,7.55L12,9L8,5l4-4l1.4,1.45L11.85,4H12q1.88,0 3.51,0.71q1.64,0.71 2.85,1.93t1.93,2.85T21,13t-0.71,3.51t-1.93,2.85t-2.85,1.93T12,22T8.49,21.29ZM7.5,16V14.5H10v-1H8.5v-1H10v-1H7.5V10h3q0.43,0 0.71,0.29T11.5,11v4q0,0.42-0.29,0.71T10.5,16h-3Zm6,0q-0.42,0-0.71-0.29T12.5,15V11q0-0.43 0.29-0.71T13.5,10h2q0.43,0 0.71,0.29T16.5,11v4q0,0.42-0.29,0.71T15.5,16h-2ZM14,14.5h1v-3H14v3Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M7,15V9h4l5-5V20l-5-5H7Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M19.8,22.6l-3.02-3.03q-0.63,0.4-1.33,0.69T14,20.73V18.68q0.35-0.13 0.69-0.25q0.34-0.13 0.64-0.3L12,14.8V20L7,15H3V9H6.2L1.4,4.2L2.8,2.8L21.2,21.2l-1.4,1.4Zm-0.2-5.8l-1.45-1.45q0.42-0.78 0.64-1.63T19,11.98q0-2.35-1.38-4.2Q16.25,5.93 14,5.27V3.22q3.1,0.7 5.05,3.14T21,11.98q0,1.32-0.36,2.55T19.6,16.8Zm-3.35-3.35L14,11.2V7.95Q15.18,8.5 15.84,9.6T16.5,12q0,0.38-0.06,0.74t-0.19,0.71ZM12,9.2L9.4,6.6L12,4V9.2Z"/></svg>
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#e3e3e3"><path d="M14,20.73V18.68q2.25-0.65 3.63-2.5T19,11.98t-1.38-4.2Q16.25,5.93 14,5.27V3.22q3.1,0.7 5.05,3.14T21,11.98t-1.95,5.61T14,20.73ZM3,15V9H7l5-5V20L7,15H3Zm11,1V7.95Q15.18,8.5 15.84,9.6T16.5,12q0,1.27-0.66,2.36T14,16Z"/></svg>
@@ -0,0 +1,63 @@
1+#!/bin/sh
2+# make_pngs.sh regenerates the bundled PNGs in assets/icons from the SVG
3+# sources in scripts/icons. assets/ is what ships — CI zips it beside the
4+# binary and vab packages it into the APK whole — so its tree stays
5+# runtime-only: the sources live beside this script, and nothing but the
6+# PNGs ends up bundled.
7+#
8+# Each entry maps one source SVG (its export name found by prefix; Google's
9+# export names churn with every fill/weight change) to the PNG name the
10+# widget's buttons draw — the role, spelled in libvendetta/draw.v as
11+# strip_icon_names — and the colour the role draws with in the compiled-in
12+# vinix-dark palette (text_main, #ffffff, for every strip icon today). The
13+# colour step exists because the exports carry their own #e3e3e3 fill: raster
14+# colorization makes the bundle conform to the palette no matter what colour
15+# the export tool is pointed at.
16+#
17+# ImageMagick is the rasterizer for now; it renders the 24 px viewBox
18+# straight at 64 px (density 96 * 64/24 = 256), which is what the buttons and
19+# their 2x ui scale need. Swap the tool at the `one` function below if the
20+# rasterizer changes; the role and colour tables remain the stable part.
21+set -eu
22+
23+here=$(cd "$(dirname "$0")" && pwd)
24+svg_dir="$here/icons"
25+out_dir="$here/../assets/icons"
26+
27+entries='play_arrow play #ffffff
28+pause pause #ffffff
29+replay_30 replay30 #ffffff
30+forward_30 forward30 #ffffff
31+volume_up volume_up #ffffff
32+volume_mute volume_mute #ffffff
33+volume_off volume_off #ffffff'
34+
35+if command -v magick >/dev/null 2>&1; then
36+ rasterizer=magick
37+elif command -v convert >/dev/null 2>&1; then
38+ rasterizer=convert
39+else
40+ echo 'make_pngs: ImageMagick is missing: install magick (or convert) or replace it in one() here' >&2
41+ exit 1
42+fi
43+
44+one() {
45+ # one <svg-prefix> <png-name> <colour>: raster at 64 px from the SVG's 24
46+ # px viewBox, colourize the raster to the palette colour keeping alpha,
47+ # and strip the export metadata the PNG bundle does not carry.
48+ svg=$(ls "$svg_dir/${1}"_24dp_*.svg 2>/dev/null | head -n 1)
49+ if [ -z "$svg" ]; then
50+ echo "make_pngs: no *_24dp_*.svg match for prefix ${1} under ${svg_dir}" >&2
51+ exit 1
52+ fi
53+ $rasterizer -background none -density 256 "$svg" \
54+ -fill "$3" -colorize 100 -strip "$out_dir/$2.png"
55+}
56+
57+mkdir -p "$out_dir"
58+echo "$entries" | while read -r prefix png colour; do
59+ [ -z "$prefix" ] && continue
60+ one "$prefix" "$png" "$colour"
61+done
62+
63+echo 'make_pngs: bundle refreshed'
@@ -78,6 +78,7 @@ struct Config {
7878 no_preview bool @[long: 'no-preview'; xdoc: 'Start without the seek-bar hover preview, and never create the hidden thumbnail mpv instance (saves memory on low-end machines)']
7979 smooth_bar bool @[long: 'smooth-bar'; xdoc: 'Start with the smooth seek bar: while the file plays, the UI redraws at the display rate so the bar glides between mpv\'s position reports']
8080 no_smooth_bar bool @[long: 'no-smooth-bar'; xdoc: 'Start with strictly asked redraws only: the bar steps to each position report mpv makes']
81+ slider_height f64 = -1 @[long: 'slider-height'; xdoc: 'Height of the seek and volume bars in pixels, 1 to 30 (default: the saved setting)']
8182 media_controls bool @[long: 'media-controls'; xdoc: 'Expose the desktop media controls (MPRIS on the session bus) (default: the saved setting)']
8283 no_media_controls bool @[long: 'no-media-controls'; xdoc: 'Do not expose the desktop media controls']
8384 ao string @[long: 'ao'; xdoc: 'Audio server: auto (mpv\'s autoprobing) or a named output, e.g. pipewire, pulse, alsa (default: the saved audio server)']
@@ -45,6 +45,9 @@ pub mut:
4545 // between mpv's position reports and redraws the window at the display rate
4646 // while it plays.
4747 smooth_bar bool
48+ // The height of the seek and volume bars; 0, as in a file saved before the
49+ // setting existed, keeps the widget's default.
50+ slider_height f64
4851 // The window title's two halves, shown while set (both default on):
4952 // '(paused)' while playback is paused, then the playing file's name.
5053 show_playback_status bool = true
@@ -179,6 +182,7 @@ fn (p &Player) collect_settings() Settings {
179182 low_quality: p.low_quality
180183 continuous: p.continuous
181184 smooth_bar: p.smooth_bar
185+ slider_height: p.cfg.slider_h
182186 show_playback_status: p.show_playback_status
183187 show_title_filename: p.show_title_filename
184188 theme: p.theme_name
@@ -272,6 +276,9 @@ fn (mut p Player) apply_settings(s Settings) {
272276 // The smooth bar needs no start-up work: its glide arms itself from the
273277 // first time-pos report, and the chain dies on a pause by itself.
274278 p.smooth_bar = s.smooth_bar
279+ if s.slider_height > 0 {
280+ p.cfg.slider_h = s.slider_height
281+ }
275282 // The title needs none either: the two rows only reshape what the
276283 // property events write, and the window opens before anything plays.
277284 p.show_playback_status = s.show_playback_status
@@ -343,6 +350,9 @@ fn (mut p Player) apply_cli(cfg Config) {
343350 } else if cfg.smooth_bar {
344351 p.smooth_bar = true
345352 }
353+ if cfg.slider_height > 0 {
354+ p.cfg.slider_h = cfg.slider_height
355+ }
346356 if cfg.volume >= 0 {
347357 p.volume = cfg.volume
348358 if p.volume > p.max_volume {