Compare commits
2 commits
5c6a8557b3
...
6a20172ee4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a20172ee4 | ||
|
|
8bdb32623f |
19 changed files with 856 additions and 209 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -6550,7 +6550,7 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yandex-music-rs"
|
name = "yandex-music-rs"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "yandex-music-rs"
|
name = "yandex-music-rs"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Native high-performance, ultra-low-RAM Yandex Music desktop client in Rust + ash Vulkan SDF + taffy + cosmic-text"
|
description = "Native high-performance, ultra-low-RAM Yandex Music desktop client in Rust + ash Vulkan SDF + taffy + cosmic-text"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
Готовые сборки доступны на странице [Releases](https://git.tatar/marwy/yandex-music-rs/releases):
|
Готовые сборки доступны на странице [Releases](https://git.tatar/marwy/yandex-music-rs/releases):
|
||||||
|
|
||||||
- **Windows (x64)**: скачайте `yandex-music-rs-v0.1.7-windows-x86_64.exe` и запустите (переносной файл, установка не требуется).
|
- **Windows (x64)**: скачайте `yandex-music-rs-v0.1.8-windows-x86_64.exe` и запустите (переносной файл, установка не требуется).
|
||||||
- **Linux (Debian / Ubuntu x64)**: скачайте `yandex-music-rs_0.1.7-1_amd64.deb` и установите:
|
- **Linux (Debian / Ubuntu x64)**: скачайте `yandex-music-rs_0.1.8-1_amd64.deb` и установите:
|
||||||
```bash
|
```bash
|
||||||
sudo apt install ./yandex-music-rs_0.1.7-1_amd64.deb
|
sudo apt install ./yandex-music-rs_0.1.8-1_amd64.deb
|
||||||
```
|
```
|
||||||
- **Linux (generic x64)**: архив `yandex-music-rs-v0.1.7-linux-x86_64.tar.gz` с готовыми бинарниками (`yandex-music-rs` + `yandex-music-auth`).
|
- **Linux (generic x64)**: архив `yandex-music-rs-v0.1.8-linux-x86_64.tar.gz` с готовыми бинарниками (`yandex-music-rs` + `yandex-music-auth`).
|
||||||
|
|
||||||
## Стек и возможности
|
## Стек и возможности
|
||||||
|
|
||||||
|
|
|
||||||
54
assets/icons/thumb_car.svg
Normal file
54
assets/icons/thumb_car.svg
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 156 48" width="156" height="48">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="carRed" x1="0" y1="0" x2="0.15" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#FF2942"/>
|
||||||
|
<stop offset="48%" stop-color="#D90F26"/>
|
||||||
|
<stop offset="100%" stop-color="#8C0717"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="carHighlight" x1="0" y1="0" x2="1" y2="0">
|
||||||
|
<stop offset="0%" stop-color="#FF7A89" stop-opacity="0.25"/>
|
||||||
|
<stop offset="45%" stop-color="#FF99A5" stop-opacity="0.85"/>
|
||||||
|
<stop offset="100%" stop-color="#FF7A89" stop-opacity="0.2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="carGlass" x1="0" y1="0" x2="1" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#4A5568"/>
|
||||||
|
<stop offset="45%" stop-color="#1A1E26"/>
|
||||||
|
<stop offset="100%" stop-color="#0D0F14"/>
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient id="rimGrad" cx="50%" cy="50%" r="50%">
|
||||||
|
<stop offset="0%" stop-color="#F5F7FA"/>
|
||||||
|
<stop offset="60%" stop-color="#B8C0CC"/>
|
||||||
|
<stop offset="100%" stop-color="#5C6470"/>
|
||||||
|
</radialGradient>
|
||||||
|
</defs>
|
||||||
|
<!-- Underbody shadow -->
|
||||||
|
<rect x="12" y="37" width="134" height="4" rx="2" fill="#09090C"/>
|
||||||
|
<!-- Main supercar silhouette -->
|
||||||
|
<path d="M8 29.5L10.5 19.5C12.5 16.5 22 14.8 38 14.2L57 8.4C67 5.6 82 5.4 95 7.4L115 15.2C131 16.4 143 19.8 148.5 24.5C150.5 26.2 151.5 29.2 150.5 32.5L146.5 36.2L134 36.8H22L10.5 35.5C8 34.8 7.2 32.2 8 29.5Z" fill="url(#carRed)"/>
|
||||||
|
<!-- Roof & shoulder highlight -->
|
||||||
|
<path d="M18 19.8C36 17.5 64 16.8 106 18.2C125 18.8 139 21.4 146 25" stroke="url(#carHighlight)" stroke-width="1.8" fill="none" stroke-linecap="round"/>
|
||||||
|
<!-- Side cabin glass -->
|
||||||
|
<path d="M55 15.6L71 9.6C80 8.5 91 8.8 101 11.4L111 16.2L55 16.4Z" fill="url(#carGlass)"/>
|
||||||
|
<path d="M77 9.4L73 16.2" stroke="#111318" stroke-width="2.2"/>
|
||||||
|
<!-- Side air intake & door sculpt -->
|
||||||
|
<path d="M46 24.5L68 21.5L66 30.5L47 30.2Z" fill="#5E0611" opacity="0.82"/>
|
||||||
|
<path d="M68 23.2L104 23.8L98 28.6L67 28.4Z" fill="#9E0B1D" opacity="0.65"/>
|
||||||
|
<!-- Tail light -->
|
||||||
|
<path d="M9.5 20.5L18 20L17 24.2L9 24Z" fill="#FF595E"/>
|
||||||
|
<!-- Headlight -->
|
||||||
|
<path d="M134 22.8L147 25.4L144.5 28.4L132 25.6Z" fill="#FFF2A6"/>
|
||||||
|
<path d="M136 23.6L145 25.6" stroke="#FFFFFF" stroke-width="1.3" stroke-linecap="round"/>
|
||||||
|
<!-- Wheel arches -->
|
||||||
|
<circle cx="34" cy="34.5" r="11.2" fill="#121317"/>
|
||||||
|
<circle cx="122" cy="34.5" r="11.2" fill="#121317"/>
|
||||||
|
<!-- Rear wheel -->
|
||||||
|
<circle cx="34" cy="34.5" r="9.6" fill="#23262E"/>
|
||||||
|
<circle cx="34" cy="34.5" r="6.8" fill="url(#rimGrad)"/>
|
||||||
|
<circle cx="34" cy="34.5" r="2.2" fill="#2B2F38"/>
|
||||||
|
<path d="M34 28.2V40.8M27.7 34.5H40.3M29.6 30.1L38.4 38.9M38.4 30.1L29.6 38.9" stroke="#474E5C" stroke-width="1.15"/>
|
||||||
|
<!-- Front wheel -->
|
||||||
|
<circle cx="122" cy="34.5" r="9.6" fill="#23262E"/>
|
||||||
|
<circle cx="122" cy="34.5" r="6.8" fill="url(#rimGrad)"/>
|
||||||
|
<circle cx="122" cy="34.5" r="2.2" fill="#2B2F38"/>
|
||||||
|
<path d="M122 28.2V40.8M115.7 34.5H128.3M117.6 30.1L126.4 38.9M126.4 30.1L117.6 38.9" stroke="#474E5C" stroke-width="1.15"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3 KiB |
44
assets/icons/thumb_duck.svg
Normal file
44
assets/icons/thumb_duck.svg
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="duckBody" x1="0.2" y1="0.1" x2="0.8" y2="0.95">
|
||||||
|
<stop offset="0%" stop-color="#FFE44D"/>
|
||||||
|
<stop offset="55%" stop-color="#FFC818"/>
|
||||||
|
<stop offset="100%" stop-color="#F29F05"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="duckWing" x1="0" y1="0" x2="0.6" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#FFD833"/>
|
||||||
|
<stop offset="100%" stop-color="#E89304"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="duckBeak" x1="0" y1="0" x2="1" y2="0.8">
|
||||||
|
<stop offset="0%" stop-color="#FF8C24"/>
|
||||||
|
<stop offset="100%" stop-color="#E65200"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="wheelRim" x1="0" y1="0" x2="1" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#E64B17"/>
|
||||||
|
<stop offset="100%" stop-color="#B0280A"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<!-- Wheels -->
|
||||||
|
<circle cx="22" cy="54" r="7.5" fill="url(#wheelRim)"/>
|
||||||
|
<circle cx="22" cy="54" r="4.2" fill="#FF8F26"/>
|
||||||
|
<circle cx="22" cy="54" r="1.6" fill="#B0280A"/>
|
||||||
|
<path d="M22 49.8v8.4M17.8 54h8.4" stroke="#C8340E" stroke-width="1.2" stroke-linecap="round"/>
|
||||||
|
<circle cx="41" cy="54" r="7.5" fill="url(#wheelRim)"/>
|
||||||
|
<circle cx="41" cy="54" r="4.2" fill="#FF8F26"/>
|
||||||
|
<circle cx="41" cy="54" r="1.6" fill="#B0280A"/>
|
||||||
|
<path d="M41 49.8v8.4M36.8 54h8.4" stroke="#C8340E" stroke-width="1.2" stroke-linecap="round"/>
|
||||||
|
<!-- Beak -->
|
||||||
|
<path d="M47.5 22.5c5.8 0 11.2 1.8 11.5 4.4.2 2.2-3.4 4.1-9.2 4.3-2.5.1-4.1-.8-4.5-2.6z" fill="url(#duckBeak)"/>
|
||||||
|
<path d="M49 26.8c3.6.3 6.8-.3 8.8-1.2" stroke="#B83B00" stroke-width="1.1" fill="none" stroke-linecap="round" opacity="0.65"/>
|
||||||
|
<!-- Body + Head -->
|
||||||
|
<path d="M12.5 28.5c-2.8-1.4-4.2-3.5-3.2-4.8 1.2-1.4 4.9.2 8.2 3.4 2.4 2.3 5.7 3.1 9.2 2.1 2.2-.6 2.8-2.8 1.5-5.3-1.4-2.7-1.7-5.7-.9-8.8C29 9.5 34.1 6.5 39.8 7c6.4.5 11.3 5.5 11.4 11.8.1 3.7-1.6 7-3.9 9.1-1.3 1.2-1.4 2.4-.2 3.8 2.8 3.2 4.1 7.1 3.5 11.2-.9 6.2-6.1 10.6-13.2 10.9H25.2c-8.2 0-14.6-5.2-15.4-12.6-.5-4.6.6-9.1 2.7-12.7z" fill="url(#duckBody)"/>
|
||||||
|
<!-- Head highlight -->
|
||||||
|
<ellipse cx="36.5" cy="12.5" rx="6" ry="3" transform="rotate(-14 36.5 12.5)" fill="#FFF59D" opacity="0.55"/>
|
||||||
|
<!-- Wing -->
|
||||||
|
<path d="M19.5 36.2c5.4-2.2 13.5-1.5 16.6 2.7 1.7 2.3.9 5.9-2.4 7.7-4.4 2.4-11.2 1.6-14.7-1.7-2.4-2.3-2.3-7.5.5-8.7z" fill="url(#duckWing)"/>
|
||||||
|
<path d="M21.5 38.4c4.3-1.2 9.4-.6 12.1 1.6" stroke="#FFF29A" stroke-width="1.4" fill="none" stroke-linecap="round" opacity="0.6"/>
|
||||||
|
<!-- Eye -->
|
||||||
|
<circle cx="42.4" cy="18.2" r="3.6" fill="#1A1D24"/>
|
||||||
|
<circle cx="43.5" cy="16.9" r="1.25" fill="#FFFFFF"/>
|
||||||
|
<circle cx="41.1" cy="19.5" r="0.55" fill="#FFFFFF" opacity="0.65"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.6 KiB |
|
|
@ -9,7 +9,7 @@ use crate::api::models::*;
|
||||||
use crate::api::signing::{extract_oauth_token, generate_request_id, iso8601_now};
|
use crate::api::signing::{extract_oauth_token, generate_request_id, iso8601_now};
|
||||||
use crate::api::{open_url_in_browser, YandexApiClient, YANDEX_OAUTH_URL};
|
use crate::api::{open_url_in_browser, YandexApiClient, YANDEX_OAUTH_URL};
|
||||||
use crate::audio::AudioEngine;
|
use crate::audio::AudioEngine;
|
||||||
use crate::config::{AppConfig, AudioQuality, Language, PinnedItem, ThemeMode};
|
use crate::config::{AppConfig, AudioQuality, Language, PinnedItem, PlayerThumbStyle, ThemeMode};
|
||||||
use crate::telemetry::PerfTelemetry;
|
use crate::telemetry::PerfTelemetry;
|
||||||
use crate::vulkan::vibe_renderer::VibePushConstants;
|
use crate::vulkan::vibe_renderer::VibePushConstants;
|
||||||
|
|
||||||
|
|
@ -378,6 +378,7 @@ pub enum AppAction {
|
||||||
SetAiContentReduction(bool),
|
SetAiContentReduction(bool),
|
||||||
SetChildMode(bool),
|
SetChildMode(bool),
|
||||||
SetCloseToTray(bool),
|
SetCloseToTray(bool),
|
||||||
|
SetPlayerThumb(PlayerThumbStyle),
|
||||||
UpdateEq {
|
UpdateEq {
|
||||||
enabled: bool,
|
enabled: bool,
|
||||||
preamp: f32,
|
preamp: f32,
|
||||||
|
|
@ -1088,6 +1089,13 @@ impl AppState {
|
||||||
}
|
}
|
||||||
|
|
||||||
if playing {
|
if playing {
|
||||||
|
// Animated player bar companion (Duck/Car/Claudik/Antigravity/Ferris/Nyan): smooth 30 FPS when focused!
|
||||||
|
if window_focused
|
||||||
|
&& self.config.player_thumb != PlayerThumbStyle::Standard
|
||||||
|
&& !self.fullscreen_open
|
||||||
|
{
|
||||||
|
return Some(Duration::from_millis(33));
|
||||||
|
}
|
||||||
// Static pages (Favorites, ForYou, Search, Collection, Fullscreen, Detail):
|
// Static pages (Favorites, ForYou, Search, Collection, Fullscreen, Detail):
|
||||||
// Progress bar moves ~1px every 150-250ms; no reason to spin GPU at 60 FPS!
|
// Progress bar moves ~1px every 150-250ms; no reason to spin GPU at 60 FPS!
|
||||||
let lyrics_visible = (self.fullscreen_open && self.fullscreen_lyrics_open)
|
let lyrics_visible = (self.fullscreen_open && self.fullscreen_lyrics_open)
|
||||||
|
|
@ -3130,6 +3138,10 @@ impl AppState {
|
||||||
self.config.close_to_tray = v;
|
self.config.close_to_tray = v;
|
||||||
self.save_config();
|
self.save_config();
|
||||||
}
|
}
|
||||||
|
AppAction::SetPlayerThumb(style) => {
|
||||||
|
self.config.player_thumb = style;
|
||||||
|
self.save_config();
|
||||||
|
}
|
||||||
AppAction::UpdateEq {
|
AppAction::UpdateEq {
|
||||||
enabled,
|
enabled,
|
||||||
preamp,
|
preamp,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,48 @@ pub enum ThemeMode {
|
||||||
Light,
|
Light,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||||
|
pub enum PlayerThumbStyle {
|
||||||
|
#[default]
|
||||||
|
Standard,
|
||||||
|
Duck,
|
||||||
|
Car,
|
||||||
|
Claudik,
|
||||||
|
Antigravity,
|
||||||
|
Ferris,
|
||||||
|
Nyan,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PlayerThumbStyle {
|
||||||
|
pub const ALL: &'static [Self] = &[
|
||||||
|
Self::Standard,
|
||||||
|
Self::Duck,
|
||||||
|
Self::Car,
|
||||||
|
Self::Claudik,
|
||||||
|
Self::Antigravity,
|
||||||
|
Self::Ferris,
|
||||||
|
Self::Nyan,
|
||||||
|
];
|
||||||
|
|
||||||
|
pub const fn label(self, ru: bool) -> &'static str {
|
||||||
|
match (self, ru) {
|
||||||
|
(Self::Standard, true) => "Стандартный",
|
||||||
|
(Self::Standard, false) => "Default",
|
||||||
|
(Self::Duck, true) => "Уточка",
|
||||||
|
(Self::Duck, false) => "Duck",
|
||||||
|
(Self::Car, true) => "Машинка",
|
||||||
|
(Self::Car, false) => "Car",
|
||||||
|
(Self::Claudik, true) => "Клодик",
|
||||||
|
(Self::Claudik, false) => "Claudik",
|
||||||
|
(Self::Antigravity, _) => "Antigravity",
|
||||||
|
(Self::Ferris, true) => "Феррис",
|
||||||
|
(Self::Ferris, false) => "Ferris",
|
||||||
|
(Self::Nyan, true) => "Нян-кот",
|
||||||
|
(Self::Nyan, false) => "Nyan Cat",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ThemeMode {
|
impl ThemeMode {
|
||||||
/// Resolve `ThemeMode::System` to concrete dark/light boolean via Windows Registry `AppsUseLightTheme`
|
/// Resolve `ThemeMode::System` to concrete dark/light boolean via Windows Registry `AppsUseLightTheme`
|
||||||
/// (exact match to Chromium's `prefers-color-scheme: light` in Electron 5.129.0).
|
/// (exact match to Chromium's `prefers-color-scheme: light` in Electron 5.129.0).
|
||||||
|
|
@ -165,6 +207,8 @@ pub struct AppConfig {
|
||||||
pub child_mode: bool,
|
pub child_mode: bool,
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
pub close_to_tray: bool,
|
pub close_to_tray: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub player_thumb: PlayerThumbStyle,
|
||||||
pub max_cover_cache: usize,
|
pub max_cover_cache: usize,
|
||||||
pub show_perf_hud: bool,
|
pub show_perf_hud: bool,
|
||||||
pub search_history: Vec<String>,
|
pub search_history: Vec<String>,
|
||||||
|
|
@ -220,6 +264,7 @@ impl Default for AppConfig {
|
||||||
ai_content_reduction: false,
|
ai_content_reduction: false,
|
||||||
child_mode: false,
|
child_mode: false,
|
||||||
close_to_tray: true,
|
close_to_tray: true,
|
||||||
|
player_thumb: PlayerThumbStyle::Standard,
|
||||||
max_cover_cache: 256,
|
max_cover_cache: 256,
|
||||||
show_perf_hud: false,
|
show_perf_hud: false,
|
||||||
search_history: Vec::new(),
|
search_history: Vec::new(),
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ impl InputState {
|
||||||
self.pointer_pos = Some(next);
|
self.pointer_pos = Some(next);
|
||||||
if self.left_down {
|
if self.left_down {
|
||||||
if let Some(origin) = self.drag_origin {
|
if let Some(origin) = self.drag_origin {
|
||||||
if origin.distance(next) >= 3.0 {
|
if origin.distance(next) >= 5.0 {
|
||||||
self.is_dragging = true;
|
self.is_dragging = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -407,7 +407,7 @@ impl InputState {
|
||||||
let prev_time = self.time;
|
let prev_time = self.time;
|
||||||
self.time = time;
|
self.time = time;
|
||||||
self.dt = if prev_time > 0.0 && time > prev_time {
|
self.dt = if prev_time > 0.0 && time > prev_time {
|
||||||
((time - prev_time) as f32).clamp(0.001, 0.1)
|
((time - prev_time) as f32).clamp(0.001, 0.033)
|
||||||
} else {
|
} else {
|
||||||
1.0 / 60.0
|
1.0 / 60.0
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,9 @@ impl UiContext {
|
||||||
let texture_uploads = self.textures.drain_uploads();
|
let texture_uploads = self.textures.drain_uploads();
|
||||||
let immediate_repaint =
|
let immediate_repaint =
|
||||||
self.repaint_requested || self.animator.needs_repaint() || !texture_uploads.is_empty();
|
self.repaint_requested || self.animator.needs_repaint() || !texture_uploads.is_empty();
|
||||||
let repaint_after = if immediate_repaint {
|
let repaint_after = if self.repaint_requested || !texture_uploads.is_empty() {
|
||||||
|
Some(std::time::Duration::from_millis(1))
|
||||||
|
} else if self.animator.needs_repaint() {
|
||||||
Some(std::time::Duration::from_millis(16))
|
Some(std::time::Duration::from_millis(16))
|
||||||
} else {
|
} else {
|
||||||
self.repaint_after
|
self.repaint_after
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ pub enum Icon {
|
||||||
YandexIdLogoRuLight,
|
YandexIdLogoRuLight,
|
||||||
YandexIdLogoEnDark,
|
YandexIdLogoEnDark,
|
||||||
YandexIdLogoEnLight,
|
YandexIdLogoEnLight,
|
||||||
|
ThumbDuck,
|
||||||
|
ThumbCar,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Icon {
|
impl Icon {
|
||||||
|
|
@ -259,6 +261,8 @@ impl Icon {
|
||||||
Icon::YandexIdLogoRuLight => include_bytes!("../assets/icons/yandex_id_logo_ru_light.svg"),
|
Icon::YandexIdLogoRuLight => include_bytes!("../assets/icons/yandex_id_logo_ru_light.svg"),
|
||||||
Icon::YandexIdLogoEnDark => include_bytes!("../assets/icons/yandex_id_logo_en_dark.svg"),
|
Icon::YandexIdLogoEnDark => include_bytes!("../assets/icons/yandex_id_logo_en_dark.svg"),
|
||||||
Icon::YandexIdLogoEnLight => include_bytes!("../assets/icons/yandex_id_logo_en_light.svg"),
|
Icon::YandexIdLogoEnLight => include_bytes!("../assets/icons/yandex_id_logo_en_light.svg"),
|
||||||
|
Icon::ThumbDuck => include_bytes!("../assets/icons/thumb_duck.svg"),
|
||||||
|
Icon::ThumbCar => include_bytes!("../assets/icons/thumb_car.svg"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,6 +275,8 @@ impl Icon {
|
||||||
| Icon::YandexIdLogoRuLight
|
| Icon::YandexIdLogoRuLight
|
||||||
| Icon::YandexIdLogoEnDark
|
| Icon::YandexIdLogoEnDark
|
||||||
| Icon::YandexIdLogoEnLight => (124, 60),
|
| Icon::YandexIdLogoEnLight => (124, 60),
|
||||||
|
Icon::ThumbDuck => (96, 96),
|
||||||
|
Icon::ThumbCar => (220, 68),
|
||||||
Icon::MusicLogo | Icon::PlayFilled | Icon::PauseFilled | Icon::PlayLarge | Icon::PauseLarge => (72, 72),
|
Icon::MusicLogo | Icon::PlayFilled | Icon::PauseFilled | Icon::PlayLarge | Icon::PauseLarge => (72, 72),
|
||||||
_ => (48, 48),
|
_ => (48, 48),
|
||||||
}
|
}
|
||||||
|
|
@ -406,6 +412,8 @@ impl Icon {
|
||||||
Icon::YandexIdLogoRuLight,
|
Icon::YandexIdLogoRuLight,
|
||||||
Icon::YandexIdLogoEnDark,
|
Icon::YandexIdLogoEnDark,
|
||||||
Icon::YandexIdLogoEnLight,
|
Icon::YandexIdLogoEnLight,
|
||||||
|
Icon::ThumbDuck,
|
||||||
|
Icon::ThumbCar,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ use crate::engine::input::WidgetId;
|
||||||
use crate::engine::scroll::visible_row_range;
|
use crate::engine::scroll::visible_row_range;
|
||||||
use crate::engine::text::{TextAlign, TextStyle};
|
use crate::engine::text::{TextAlign, TextStyle};
|
||||||
use crate::engine::theme::{YmPalette, TRACK_ROW_HEIGHT};
|
use crate::engine::theme::{YmPalette, TRACK_ROW_HEIGHT};
|
||||||
use crate::engine::types::{CornerRadii, CursorKind, Pos2, Rect, Vec2};
|
use crate::engine::types::{Color, CornerRadii, CursorKind, Pos2, Rect, Vec2};
|
||||||
use crate::engine::widgets::{
|
use crate::engine::widgets::{
|
||||||
draw_cover_art, media_card, secondary_pill_button, separated_artists, text_input_widget,
|
draw_cover_art, media_card, separated_artists, text_input_widget,
|
||||||
track_row, yellow_pill_button, TextInputOptions, TrackRowAction, TrackRowOptions,
|
track_row, yellow_pill_button, TextInputOptions, TrackRowAction, TrackRowOptions,
|
||||||
};
|
};
|
||||||
use crate::engine::UiContext;
|
use crate::engine::UiContext;
|
||||||
|
|
@ -769,16 +769,29 @@ pub fn render_detail(
|
||||||
None => chip.id == "all",
|
None => chip.id == "all",
|
||||||
Some(sel) => sel == &chip.id,
|
Some(sel) => sel == &chip.id,
|
||||||
};
|
};
|
||||||
let (resp, r) = secondary_pill_button(
|
let chip_id = WidgetId::from_pair("fav_chip", &chip.id);
|
||||||
ctx,
|
let text_sz = ctx.measure_text(&chip.name, TextStyle::bold(14.0, pal.text_primary), None);
|
||||||
pal,
|
let w = (text_sz.x + 36.0).clamp(48.0, 200.0);
|
||||||
WidgetId::from_pair("fav_chip", &chip.id),
|
let r = Rect::from_xywh(cx, y, w, 40.0);
|
||||||
Pos2::new(cx, y),
|
let resp = ctx.interact(chip_id, r);
|
||||||
None,
|
// Official `PlaylistFilter_root`: idle `#333` dark / `#E6E6E6` light; on hover slightly darkens (`#282828` / `#D6D6D6`)!
|
||||||
|
let hover_bg = if pal.is_dark {
|
||||||
|
Color::rgb(0x28, 0x28, 0x28)
|
||||||
|
} else {
|
||||||
|
Color::rgb(0xD6, 0xD6, 0xD6)
|
||||||
|
};
|
||||||
|
let bg = if resp.hovered { hover_bg } else { pal.chip_bg };
|
||||||
|
let border_col = if is_selected { pal.outline_selected } else { bg };
|
||||||
|
ctx.dl().push_rect_bordered(r, 20.0, bg, 2.0, border_col);
|
||||||
|
ctx.draw_text_ellipsis(
|
||||||
&chip.name,
|
&chip.name,
|
||||||
40.0,
|
TextStyle::bold(14.0, pal.text_primary),
|
||||||
is_selected,
|
Rect::from_xywh(r.left() + 16.0, r.top(), (r.width() - 32.0).max(12.0), r.height()),
|
||||||
|
TextAlign::Center,
|
||||||
);
|
);
|
||||||
|
if resp.hovered {
|
||||||
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
|
}
|
||||||
if resp.clicked {
|
if resp.clicked {
|
||||||
let next_id = if chip.id == "all" {
|
let next_id = if chip.id == "all" {
|
||||||
None
|
None
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ pub mod for_you;
|
||||||
pub mod my_vibe;
|
pub mod my_vibe;
|
||||||
pub mod overlays;
|
pub mod overlays;
|
||||||
pub mod player_bar;
|
pub mod player_bar;
|
||||||
|
pub mod player_thumbs;
|
||||||
pub mod podcasts_kids;
|
pub mod podcasts_kids;
|
||||||
pub mod search;
|
pub mod search;
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
|
|
@ -549,17 +550,17 @@ impl YandexMusicShell {
|
||||||
ease_out(self.ui.animate_bool(
|
ease_out(self.ui.animate_bool(
|
||||||
WidgetId::new("ym_quality_popover_anim"),
|
WidgetId::new("ym_quality_popover_anim"),
|
||||||
self.app.eq_popover_open,
|
self.app.eq_popover_open,
|
||||||
0.18,
|
0.22,
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
let eq_expand_t = if self.app.fixed_vibe_time.is_some() {
|
let eq_expand_t = if self.app.fixed_vibe_time.is_some() {
|
||||||
if self.app.config.eq_enabled { 1.0 } else { 0.0 }
|
if self.app.config.eq_enabled { 1.0 } else { 0.0 }
|
||||||
} else {
|
} else {
|
||||||
ease_out(self.ui.animate_bool(
|
self.ui.animate_bool(
|
||||||
WidgetId::new("ym_quality_eq_expand"),
|
WidgetId::new("ym_quality_eq_expand"),
|
||||||
self.app.config.eq_enabled,
|
self.app.config.eq_enabled,
|
||||||
0.20,
|
0.20,
|
||||||
))
|
)
|
||||||
};
|
};
|
||||||
if eq_pop_t > 0.01 {
|
if eq_pop_t > 0.01 {
|
||||||
render_eq_popover(
|
render_eq_popover(
|
||||||
|
|
@ -671,9 +672,16 @@ impl YandexMusicShell {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dispatch all actions emitted during this frame
|
// Dispatch all actions emitted during this frame
|
||||||
|
let had_actions = !actions.is_empty();
|
||||||
for act in actions {
|
for act in actions {
|
||||||
self.app.dispatch(act);
|
self.app.dispatch(act);
|
||||||
}
|
}
|
||||||
|
// Any dispatched UI action may open/close a popover, modal, or start an animation
|
||||||
|
// that wasn't evaluated yet this frame — schedule an immediate follow-up frame so
|
||||||
|
// 0 FPS idle mode never stalls opening a menu until the next mouse move.
|
||||||
|
if had_actions {
|
||||||
|
self.ui.request_repaint();
|
||||||
|
}
|
||||||
|
|
||||||
// Flush any clipboard write requested by Share > Copy link / HTML code
|
// Flush any clipboard write requested by Share > Copy link / HTML code
|
||||||
if let Some(clip_text) = self.app.take_pending_clipboard_text() {
|
if let Some(clip_text) = self.app.take_pending_clipboard_text() {
|
||||||
|
|
|
||||||
|
|
@ -764,29 +764,14 @@ pub fn render_my_vibe(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6c. Like Button (darker contrast backing when liked over bright playing orange/red gradient!)
|
// 6c. Like Button (official 5.129.0 renders a clean white filled heart when liked!)
|
||||||
let like_center = Pos2::new(capsule_r.right() + 28.0, btn_y);
|
let like_center = Pos2::new(capsule_r.right() + 28.0, btn_y);
|
||||||
if is_liked && play_fade_t > 0.1 {
|
|
||||||
ctx.dl().push_circle(
|
|
||||||
like_center,
|
|
||||||
24.0,
|
|
||||||
css_rgba(0, 0, 0, (56.0 * play_fade_t).round() as u8),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if draw_vibe_circle_btn(
|
if draw_vibe_circle_btn(
|
||||||
ctx,
|
ctx,
|
||||||
like_center,
|
like_center,
|
||||||
"vb_like",
|
"vb_like",
|
||||||
if is_liked { Icon::Liked } else { Icon::Like },
|
if is_liked { Icon::Liked } else { Icon::Like },
|
||||||
if is_liked {
|
if is_liked { col_side_hi } else { col_side_lo },
|
||||||
if play_fade_t > 0.1 {
|
|
||||||
Color::rgb(0xFF, 0x3B, 0x30)
|
|
||||||
} else {
|
|
||||||
pal.accent_coral
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
col_side_lo
|
|
||||||
},
|
|
||||||
) {
|
) {
|
||||||
if let Some(ref tr) = current_track {
|
if let Some(ref tr) = current_track {
|
||||||
actions.push(AppAction::ToggleLike(tr.clone()));
|
actions.push(AppAction::ToggleLike(tr.clone()));
|
||||||
|
|
@ -1123,9 +1108,9 @@ pub fn render_my_vibe(
|
||||||
} else {
|
} else {
|
||||||
(APP_VERSION.to_string(), pal.text_secondary)
|
(APP_VERSION.to_string(), pal.text_secondary)
|
||||||
};
|
};
|
||||||
let ver_style = TextStyle::medium(13.0, ver_col);
|
let ver_style = TextStyle::bold(13.5, ver_col);
|
||||||
let ver_w = (ctx.measure_text(&ver_label, ver_style, None).x + 22.0)
|
let ver_w = (ctx.measure_text(&ver_label, ver_style, None).x + 16.0)
|
||||||
.max(68.0)
|
.max(46.0)
|
||||||
.ceil();
|
.ceil();
|
||||||
let ver_r = Rect::from_xywh(
|
let ver_r = Rect::from_xywh(
|
||||||
(rect.right() - ver_w - 16.0).floor(),
|
(rect.right() - ver_w - 16.0).floor(),
|
||||||
|
|
|
||||||
|
|
@ -849,11 +849,7 @@ pub fn render_fullscreen_player(
|
||||||
"fs_ov_like",
|
"fs_ov_like",
|
||||||
if is_liked { Icon::Liked } else { Icon::Like },
|
if is_liked { Icon::Liked } else { Icon::Like },
|
||||||
30.0,
|
30.0,
|
||||||
if is_liked {
|
Color::WHITE,
|
||||||
pal.accent_coral
|
|
||||||
} else {
|
|
||||||
Color::WHITE
|
|
||||||
},
|
|
||||||
i18n.like(),
|
i18n.like(),
|
||||||
) {
|
) {
|
||||||
actions.push(AppAction::ToggleLike(tr.clone()));
|
actions.push(AppAction::ToggleLike(tr.clone()));
|
||||||
|
|
@ -3413,8 +3409,8 @@ pub fn render_track_detail_modal(
|
||||||
like_r,
|
like_r,
|
||||||
if is_liked { Icon::Liked } else { Icon::Like },
|
if is_liked { Icon::Liked } else { Icon::Like },
|
||||||
22.0,
|
22.0,
|
||||||
if is_liked { pal.accent_coral } else { pal.text_primary },
|
if is_liked { pal.text_bright } else { pal.text_primary },
|
||||||
if is_liked { pal.accent_coral_hover } else { pal.text_bright },
|
pal.text_bright,
|
||||||
pal.surface_hover,
|
pal.surface_hover,
|
||||||
false,
|
false,
|
||||||
i18n.like(),
|
i18n.like(),
|
||||||
|
|
@ -3710,14 +3706,15 @@ pub fn render_eq_popover(
|
||||||
total_rows_h += rh + 4.0;
|
total_rows_h += rh + 4.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header (16+32+10) + Quality rows + Divider (6+1+14) + EQ header (28) + Bottom pad (18)
|
// Header (20+32+18) + Quality rows + Gap (20) + EQ header (28) + Bottom pad (22)
|
||||||
let base_h = 58.0 + total_rows_h + 21.0 + 28.0 + 18.0;
|
let base_h = 70.0 + total_rows_h + 20.0 + 28.0 + 22.0;
|
||||||
let eq_extra_h = 242.0 * expand_t;
|
let eq_extra_h = 246.0 * expand_t;
|
||||||
let pop_h = (base_h + eq_extra_h).min((screen.height() - PLAYER_BAR_HEIGHT - 56.0).max(280.0));
|
let pop_h = (base_h + eq_extra_h).min((screen.height() - PLAYER_BAR_HEIGHT - 56.0).max(280.0));
|
||||||
let slide_dy = (1.0 - alpha) * 12.0;
|
// Official `Modal` (`placement="right"`, `1372-8bc732062b5d53ca.js`): glides smoothly in from right edge!
|
||||||
|
let slide_dx = (1.0 - alpha) * 32.0;
|
||||||
let pop_r = Rect::from_xywh(
|
let pop_r = Rect::from_xywh(
|
||||||
(screen.right() - pop_w - 20.0).max(16.0),
|
(screen.right() - pop_w - 16.0).max(16.0) + slide_dx,
|
||||||
(screen.bottom() - PLAYER_BAR_HEIGHT - pop_h - 20.0 + slide_dy).max(40.0),
|
(screen.bottom() - PLAYER_BAR_HEIGHT - pop_h - 18.0).max(40.0),
|
||||||
pop_w,
|
pop_w,
|
||||||
pop_h,
|
pop_h,
|
||||||
);
|
);
|
||||||
|
|
@ -3737,36 +3734,39 @@ pub fn render_eq_popover(
|
||||||
24.0,
|
24.0,
|
||||||
0.0,
|
0.0,
|
||||||
Vec2::new(0.0, 6.0),
|
Vec2::new(0.0, 6.0),
|
||||||
pal.shadow_menu.with_alpha_f32(alpha),
|
pal.shadow_menu.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
ctx.dl().push_rect_bordered(
|
ctx.dl().push_rect_bordered(
|
||||||
pop_r,
|
pop_r,
|
||||||
16.0,
|
16.0,
|
||||||
pal.bg_popover.with_alpha_f32(alpha),
|
pal.bg_popover.scale_alpha(alpha),
|
||||||
1.0,
|
1.0,
|
||||||
pal.border_subtle.with_alpha_f32(alpha),
|
pal.border_subtle.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
|
|
||||||
ctx.push_clip(pop_r, 16.0);
|
ctx.push_clip(pop_r, 16.0);
|
||||||
|
|
||||||
// Header: `"Настройки звука"` + circular Close `×` (`QualitySettings_headerWithCloseButton`)
|
// Header: `"Настройки звука"` + filled circular Close `×` (`radius="round" color="secondary"`)
|
||||||
let hdr_r = Rect::from_xywh(pop_r.left() + 20.0, pop_r.top() + 16.0, pop_w - 40.0, 32.0);
|
let hdr_r = Rect::from_xywh(pop_r.left() + 24.0, pop_r.top() + 20.0, pop_w - 48.0, 32.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
i18n.sound_settings(),
|
i18n.sound_settings(),
|
||||||
TextStyle::headline(18.0, pal.text_bright.with_alpha_f32(alpha)),
|
TextStyle::headline(20.0, pal.text_bright.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 40.0, hdr_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
|
let close_r = Rect::from_xywh(hdr_r.right() - 32.0, hdr_r.top(), 32.0, 32.0);
|
||||||
|
ctx.dl()
|
||||||
|
.push_circle(close_r.center(), 16.0, pal.surface_hover.scale_alpha(alpha));
|
||||||
if open
|
if open
|
||||||
&& icon_button(
|
&& icon_button(
|
||||||
ctx,
|
ctx,
|
||||||
WidgetId::new("qs_close_btn"),
|
WidgetId::new("qs_close_btn"),
|
||||||
Rect::from_xywh(hdr_r.right() - 28.0, hdr_r.top() + 2.0, 28.0, 28.0),
|
close_r,
|
||||||
Icon::Close,
|
Icon::Close,
|
||||||
13.0,
|
14.0,
|
||||||
pal.text_secondary,
|
pal.text_bright.scale_alpha(alpha),
|
||||||
pal.text_bright,
|
pal.text_bright.scale_alpha(alpha),
|
||||||
pal.surface_hover,
|
pal.surface_hover.scale_alpha(alpha),
|
||||||
false,
|
false,
|
||||||
i18n.close(),
|
i18n.close(),
|
||||||
)
|
)
|
||||||
|
|
@ -3777,7 +3777,7 @@ pub fn render_eq_popover(
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3 Official Quality Options (`QualitySettings_item`)
|
// 3 Official Quality Options (`QualitySettings_item`)
|
||||||
let mut y = hdr_r.bottom() + 10.0;
|
let mut y = hdr_r.bottom() + 18.0;
|
||||||
for (idx, (q, title, sub)) in qualities.iter().enumerate() {
|
for (idx, (q, title, sub)) in qualities.iter().enumerate() {
|
||||||
let rh = row_heights[idx];
|
let rh = row_heights[idx];
|
||||||
let row_r = Rect::from_xywh(pop_r.left() + 10.0, y, pop_w - 20.0, rh);
|
let row_r = Rect::from_xywh(pop_r.left() + 10.0, y, pop_w - 20.0, rh);
|
||||||
|
|
@ -3789,20 +3789,20 @@ pub fn render_eq_popover(
|
||||||
let active = app.config.audio_quality == *q;
|
let active = app.config.audio_quality == *q;
|
||||||
if resp.hovered {
|
if resp.hovered {
|
||||||
ctx.dl()
|
ctx.dl()
|
||||||
.push_rect(row_r, 10.0, pal.surface_hover.with_alpha_f32(alpha));
|
.push_rect(row_r, 10.0, pal.surface_hover.scale_alpha(alpha));
|
||||||
ctx.set_cursor(CursorKind::Pointer);
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
}
|
}
|
||||||
let row_txt_x = row_r.left() + 14.0;
|
let row_txt_x = row_r.left() + 14.0;
|
||||||
let row_txt_w = (row_r.width() - 48.0).max(80.0);
|
let row_txt_w = (row_r.width() - 48.0).max(80.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
title,
|
title,
|
||||||
TextStyle::bold(14.5, pal.text_bright.with_alpha_f32(alpha)),
|
TextStyle::bold(14.5, pal.text_bright.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(row_txt_x, row_r.top() + 9.0, row_txt_w, 19.0),
|
Rect::from_xywh(row_txt_x, row_r.top() + 9.0, row_txt_w, 19.0),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
ctx.draw_text_wrapped(
|
ctx.draw_text_wrapped(
|
||||||
sub,
|
sub,
|
||||||
TextStyle::regular(12.0, pal.text_secondary.with_alpha_f32(alpha)),
|
TextStyle::regular(12.0, pal.text_secondary.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(row_txt_x, row_r.top() + 31.0, row_txt_w, rh - 36.0),
|
Rect::from_xywh(row_txt_x, row_r.top() + 31.0, row_txt_w, rh - 36.0),
|
||||||
None,
|
None,
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
|
|
@ -3814,7 +3814,7 @@ pub fn render_eq_popover(
|
||||||
Pos2::new(row_r.right() - 18.0, row_r.center_y()),
|
Pos2::new(row_r.right() - 18.0, row_r.center_y()),
|
||||||
Vec2::splat(16.0),
|
Vec2::splat(16.0),
|
||||||
),
|
),
|
||||||
pal.text_bright.with_alpha_f32(alpha),
|
pal.text_bright.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if resp.clicked && !active {
|
if resp.clicked && !active {
|
||||||
|
|
@ -3823,19 +3823,13 @@ pub fn render_eq_popover(
|
||||||
y += rh + 4.0;
|
y += rh + 4.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hairline divider before Equalizer section
|
// Clean official vertical spacing before Equalizer section (no extra divider line)
|
||||||
y += 6.0;
|
y += 20.0;
|
||||||
ctx.dl().push_rect(
|
|
||||||
Rect::from_xywh(pop_r.left() + 20.0, y, pop_w - 40.0, 1.0),
|
|
||||||
0.0,
|
|
||||||
pal.border_subtle.with_alpha_f32(alpha),
|
|
||||||
);
|
|
||||||
y += 14.0;
|
|
||||||
|
|
||||||
// Inline Official Equalizer (`Equalizer_header` + animated expandable Preamp + 10 bands + Presets)
|
// Inline Official Equalizer (`Equalizer_header` + animated expandable Preamp + 10 bands + Presets)
|
||||||
let eq_area = Rect::from_min_max(
|
let eq_area = Rect::from_min_max(
|
||||||
Pos2::new(pop_r.left() + 20.0, y),
|
Pos2::new(pop_r.left() + 24.0, y),
|
||||||
Pos2::new(pop_r.right() - 20.0, pop_r.bottom() - 16.0),
|
Pos2::new(pop_r.right() - 24.0, pop_r.bottom() - 20.0),
|
||||||
);
|
);
|
||||||
let dd_anchor = render_equalizer_body(
|
let dd_anchor = render_equalizer_body(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
@ -3914,10 +3908,9 @@ pub fn render_equalizer_modal(
|
||||||
let alpha = anim_t.clamp(0.0, 1.0);
|
let alpha = anim_t.clamp(0.0, 1.0);
|
||||||
let screen = ctx.screen_rect();
|
let screen = ctx.screen_rect();
|
||||||
let modal_w = (screen.width() - 48.0).clamp(320.0, 430.0);
|
let modal_w = (screen.width() - 48.0).clamp(320.0, 430.0);
|
||||||
let modal_h = 376.0;
|
let modal_h = 370.0;
|
||||||
let slide_dy = (1.0 - alpha) * 14.0;
|
|
||||||
let modal_r = Rect::from_center_size(
|
let modal_r = Rect::from_center_size(
|
||||||
Pos2::new(screen.center_x(), screen.center_y() + slide_dy),
|
Pos2::new(screen.center_x(), screen.center_y()),
|
||||||
Vec2::new(modal_w, modal_h),
|
Vec2::new(modal_w, modal_h),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -3941,33 +3934,36 @@ pub fn render_equalizer_modal(
|
||||||
32.0,
|
32.0,
|
||||||
0.0,
|
0.0,
|
||||||
Vec2::new(0.0, 8.0),
|
Vec2::new(0.0, 8.0),
|
||||||
pal.shadow_modal.with_alpha_f32(alpha),
|
pal.shadow_modal.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
ctx.dl().push_rect_bordered(
|
ctx.dl().push_rect_bordered(
|
||||||
modal_r,
|
modal_r,
|
||||||
16.0,
|
16.0,
|
||||||
pal.bg_popover.with_alpha_f32(alpha),
|
pal.bg_popover.scale_alpha(alpha),
|
||||||
1.0,
|
1.0,
|
||||||
pal.border_subtle.with_alpha_f32(alpha),
|
pal.border_subtle.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
|
|
||||||
let hdr_r = Rect::from_xywh(modal_r.left() + 20.0, modal_r.top() + 18.0, modal_w - 40.0, 32.0);
|
let hdr_r = Rect::from_xywh(modal_r.left() + 24.0, modal_r.top() + 20.0, modal_w - 48.0, 32.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
if ru { "Эквалайзер" } else { "Equalizer" },
|
if ru { "Эквалайзер" } else { "Equalizer" },
|
||||||
TextStyle::headline(20.0, pal.text_bright.with_alpha_f32(alpha)),
|
TextStyle::headline(20.0, pal.text_bright.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 40.0, hdr_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
|
let eq_close_r = Rect::from_xywh(hdr_r.right() - 32.0, hdr_r.top(), 32.0, 32.0);
|
||||||
|
ctx.dl()
|
||||||
|
.push_circle(eq_close_r.center(), 16.0, pal.surface_hover.scale_alpha(alpha));
|
||||||
if open
|
if open
|
||||||
&& icon_button(
|
&& icon_button(
|
||||||
ctx,
|
ctx,
|
||||||
WidgetId::new("eq_modal_close"),
|
WidgetId::new("eq_modal_close"),
|
||||||
Rect::from_xywh(hdr_r.right() - 30.0, hdr_r.top() + 1.0, 30.0, 30.0),
|
eq_close_r,
|
||||||
Icon::Close,
|
Icon::Close,
|
||||||
15.0,
|
14.0,
|
||||||
pal.text_secondary,
|
pal.text_bright.scale_alpha(alpha),
|
||||||
pal.text_bright,
|
pal.text_bright.scale_alpha(alpha),
|
||||||
pal.surface_hover,
|
pal.surface_hover.scale_alpha(alpha),
|
||||||
false,
|
false,
|
||||||
i18n.close(),
|
i18n.close(),
|
||||||
)
|
)
|
||||||
|
|
@ -4041,10 +4037,10 @@ pub fn render_equalizer_modal(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Official `EqualizerSlider` (`8711fa44496b8e09.css:340-416`):
|
/// Official `EqualizerSlider` (`8711fa44496b8e09.css:340-416` + `.d6VuG0HnwpGO47uPjPeb` + `.P8_ABi1YnAOS8p8EY87f`):
|
||||||
/// - Thin `2px` muted vertical track (NO yellow fill from bottom)
|
/// - Thin `1px` (`0.0625rem`) muted vertical track (NO yellow fill from bottom)
|
||||||
/// - Centered `8×1px` `0 dB` serif tick
|
/// - Centered `8×1px` `0 dB` serif tick
|
||||||
/// - Always-visible `14px` hollow dark-filled circular thumb with `1.5px` yellow border (`border_control` when disabled)
|
/// - Always-visible `13px` (`0.8125rem`) hollow dark-filled circular thumb with `1.5px` yellow border (`border_control` when disabled)
|
||||||
fn eq_vertical_slider(
|
fn eq_vertical_slider(
|
||||||
ctx: &mut UiContext,
|
ctx: &mut UiContext,
|
||||||
pal: &YmPalette,
|
pal: &YmPalette,
|
||||||
|
|
@ -4066,10 +4062,10 @@ fn eq_vertical_slider(
|
||||||
let bot = rect.bottom() - 7.0;
|
let bot = rect.bottom() - 7.0;
|
||||||
let track_h = (bot - top).max(20.0);
|
let track_h = (bot - top).max(20.0);
|
||||||
|
|
||||||
// Thin 2px muted vertical track
|
// Thin 1.5px muted vertical track (`trackSize_xxs`)
|
||||||
let track_col = pal.border_control.with_alpha_f32(alpha);
|
let track_col = pal.border_control.scale_alpha(alpha);
|
||||||
ctx.dl()
|
ctx.dl()
|
||||||
.push_rect(Rect::from_xywh(cx - 1.0, top, 2.0, track_h), 1.0, track_col);
|
.push_rect(Rect::from_xywh(cx - 0.75, top, 1.5, track_h), 0.75, track_col);
|
||||||
|
|
||||||
// Centered 8×1px horizontal serif tick at midpoint (`EqualizerSlider_serif`)
|
// Centered 8×1px horizontal serif tick at midpoint (`EqualizerSlider_serif`)
|
||||||
ctx.dl().push_rect(
|
ctx.dl().push_rect(
|
||||||
|
|
@ -4078,19 +4074,25 @@ fn eq_vertical_slider(
|
||||||
track_col,
|
track_col,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Hollow circular thumb (`14px` diameter, `1.5px` yellow/muted ring)
|
// Official circular thumb (`14px` diameter, medium-gray interior + crisp `1.5px` yellow ring)
|
||||||
let frac = norm_val.clamp(0.0, 1.0);
|
let frac = norm_val.clamp(0.0, 1.0);
|
||||||
let thumb_y = bot - frac * track_h;
|
let thumb_y = bot - frac * track_h;
|
||||||
let thumb_r = if active { 7.5 } else { 7.0 };
|
let thumb_r = if active { 7.5 } else { 7.0 };
|
||||||
let border_col = if disabled {
|
let thumb_fill = if pal.is_dark {
|
||||||
pal.border_control.with_alpha_f32(alpha)
|
Color::rgb(0x42, 0x42, 0x42)
|
||||||
} else {
|
} else {
|
||||||
pal.yellow.with_alpha_f32(alpha)
|
Color::rgb(0xE0, 0xE0, 0xE0)
|
||||||
|
}
|
||||||
|
.scale_alpha(alpha);
|
||||||
|
let border_col = if disabled {
|
||||||
|
pal.border_control.scale_alpha(alpha)
|
||||||
|
} else {
|
||||||
|
pal.yellow.scale_alpha(alpha)
|
||||||
};
|
};
|
||||||
ctx.dl().push_rect_bordered(
|
ctx.dl().push_rect_bordered(
|
||||||
Rect::from_center_size(Pos2::new(cx, thumb_y), Vec2::splat(thumb_r * 2.0)),
|
Rect::from_center_size(Pos2::new(cx, thumb_y), Vec2::splat(thumb_r * 2.0)),
|
||||||
thumb_r,
|
thumb_r,
|
||||||
pal.bg_popover.with_alpha_f32(alpha),
|
thumb_fill,
|
||||||
1.5,
|
1.5,
|
||||||
border_col,
|
border_col,
|
||||||
);
|
);
|
||||||
|
|
@ -4114,7 +4116,7 @@ fn eq_vertical_slider(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shared official Yandex Music 5.129.0 Equalizer UI (module `31051`, `8711fa44496b8e09.css:136-422`):
|
/// Shared official Yandex Music 5.129.0 Equalizer UI (module `31051`, `8711fa44496b8e09.css:136-422`):
|
||||||
/// Header + Toggle -> Expandable (Preamp + `+12dB/0dB/-12dB` labels + 10 frequency bands) -> Full-width Pill Preset Selector.
|
/// Header + Toggle -> Expandable (Preamp + `12dB/0dB/-12dB` labels + 10 frequency bands) -> Full-width Pill Preset Selector.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn render_equalizer_body(
|
fn render_equalizer_body(
|
||||||
ctx: &mut UiContext,
|
ctx: &mut UiContext,
|
||||||
|
|
@ -4133,16 +4135,16 @@ fn render_equalizer_body(
|
||||||
interactive: bool,
|
interactive: bool,
|
||||||
salt: &str,
|
salt: &str,
|
||||||
) -> Option<(Rect, bool)> {
|
) -> Option<(Rect, bool)> {
|
||||||
// 1. Header row: Title + official Pill Toggle (`44×24`, smoothly animated)
|
// 1. Header row: Title + official Toggle (`32×20px`, `16px` knob, `rqUESGQ8jp3tbDawOzuG`)
|
||||||
let hdr_r = Rect::from_xywh(area.left(), area.top(), area.width(), 28.0);
|
let hdr_r = Rect::from_xywh(area.left(), area.top(), area.width(), 24.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
toggle_title,
|
toggle_title,
|
||||||
TextStyle::medium(16.0, pal.text_bright.with_alpha_f32(anim_alpha)),
|
TextStyle::medium(16.0, pal.text_bright.scale_alpha(anim_alpha)),
|
||||||
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 56.0, hdr_r.height()),
|
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 44.0, hdr_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
let sw_w = 44.0;
|
let sw_w = 32.0;
|
||||||
let sw_h = 24.0;
|
let sw_h = 20.0;
|
||||||
let sw_r = Rect::from_xywh(hdr_r.right() - sw_w, hdr_r.center_y() - sw_h * 0.5, sw_w, sw_h);
|
let sw_r = Rect::from_xywh(hdr_r.right() - sw_w, hdr_r.center_y() - sw_h * 0.5, sw_w, sw_h);
|
||||||
let sw_id = WidgetId::new(salt).with("toggle");
|
let sw_id = WidgetId::new(salt).with("toggle");
|
||||||
let sw_resp = if interactive {
|
let sw_resp = if interactive {
|
||||||
|
|
@ -4151,16 +4153,18 @@ fn render_equalizer_body(
|
||||||
Default::default()
|
Default::default()
|
||||||
};
|
};
|
||||||
let tog_t = ctx.animate_bool(sw_id.with("anim"), *enabled, 0.16);
|
let tog_t = ctx.animate_bool(sw_id.with("anim"), *enabled, 0.16);
|
||||||
let track_col = pal.border_control.lerp(pal.yellow, tog_t).with_alpha_f32(anim_alpha);
|
let track_col = pal.surface_hover.lerp(pal.yellow, tog_t).scale_alpha(anim_alpha);
|
||||||
ctx.dl().push_rect(sw_r, sw_h * 0.5, track_col);
|
ctx.dl().push_rect(sw_r, sw_h * 0.5, track_col);
|
||||||
let knob_x = sw_r.left() + 12.0 + tog_t * (sw_w - 24.0);
|
let knob_x = sw_r.left() + 10.0 + tog_t * 12.0;
|
||||||
let knob_col = if tog_t > 0.5 {
|
let knob_col = if tog_t > 0.5 {
|
||||||
pal.on_yellow
|
pal.on_yellow
|
||||||
} else {
|
} else if sw_resp.hovered {
|
||||||
pal.text_bright
|
pal.text_bright
|
||||||
|
} else {
|
||||||
|
pal.text_secondary
|
||||||
};
|
};
|
||||||
ctx.dl()
|
ctx.dl()
|
||||||
.push_circle(Pos2::new(knob_x, sw_r.center_y()), 9.0, knob_col.with_alpha_f32(anim_alpha));
|
.push_circle(Pos2::new(knob_x, sw_r.center_y()), 8.0, knob_col.scale_alpha(anim_alpha));
|
||||||
if sw_resp.hovered {
|
if sw_resp.hovered {
|
||||||
ctx.set_cursor(CursorKind::Pointer);
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
}
|
}
|
||||||
|
|
@ -4177,7 +4181,7 @@ fn render_equalizer_body(
|
||||||
}
|
}
|
||||||
|
|
||||||
let content_alpha = (anim_alpha * expand_t).clamp(0.0, 1.0);
|
let content_alpha = (anim_alpha * expand_t).clamp(0.0, 1.0);
|
||||||
let clip_h = (242.0 * expand_t).max(0.0);
|
let clip_h = (246.0 * expand_t).max(0.0);
|
||||||
ctx.push_clip(
|
ctx.push_clip(
|
||||||
Rect::from_xywh(area.left() - 4.0, hdr_r.bottom(), area.width() + 8.0, clip_h),
|
Rect::from_xywh(area.left() - 4.0, hdr_r.bottom(), area.width() + 8.0, clip_h),
|
||||||
0.0,
|
0.0,
|
||||||
|
|
@ -4190,7 +4194,7 @@ fn render_equalizer_body(
|
||||||
} else {
|
} else {
|
||||||
pal.text_secondary
|
pal.text_secondary
|
||||||
}
|
}
|
||||||
.with_alpha_f32(content_alpha);
|
.scale_alpha(content_alpha);
|
||||||
|
|
||||||
// 2. Left Preamp column (`Equalizer_preamp`) + amp labels (`12dB / 0dB / -12dB`)
|
// 2. Left Preamp column (`Equalizer_preamp`) + amp labels (`12dB / 0dB / -12dB`)
|
||||||
let preamp_w = 42.0;
|
let preamp_w = 42.0;
|
||||||
|
|
@ -4282,9 +4286,9 @@ fn render_equalizer_body(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Full-width Pill Preset Selector BELOW sliders (`EqualizerPresets_button`, `radius = h/2`)
|
// 4. Full-width Outlined Pill Preset Selector BELOW sliders (`EqualizerPresets_button`, `radius = h/2`)
|
||||||
let sel_y = y + sliders_h + 8.0 + 16.0 + 16.0;
|
let sel_y = y + sliders_h + 8.0 + 16.0 + 18.0;
|
||||||
let sel_h = 42.0;
|
let sel_h = 44.0;
|
||||||
let sel_r = Rect::from_xywh(area.left(), sel_y, area.width(), sel_h);
|
let sel_r = Rect::from_xywh(area.left(), sel_y, area.width(), sel_h);
|
||||||
let sel_resp = if !is_disabled && interactive && expand_t > 0.85 {
|
let sel_resp = if !is_disabled && interactive && expand_t > 0.85 {
|
||||||
ctx.interact(WidgetId::new(salt).with("preset_sel"), sel_r)
|
ctx.interact(WidgetId::new(salt).with("preset_sel"), sel_r)
|
||||||
|
|
@ -4292,23 +4296,28 @@ fn render_equalizer_body(
|
||||||
Default::default()
|
Default::default()
|
||||||
};
|
};
|
||||||
let sel_bg = if sel_resp.hovered {
|
let sel_bg = if sel_resp.hovered {
|
||||||
pal.surface_hover
|
pal.surface_hover.scale_alpha(content_alpha)
|
||||||
} else {
|
} else {
|
||||||
pal.surface_secondary
|
Color::TRANSPARENT
|
||||||
}
|
};
|
||||||
.with_alpha_f32(content_alpha);
|
let sel_border = if is_disabled {
|
||||||
ctx.dl().push_rect(sel_r, sel_h * 0.5, sel_bg);
|
pal.border_subtle.scale_alpha(content_alpha)
|
||||||
|
} else {
|
||||||
|
pal.border_control.scale_alpha(content_alpha)
|
||||||
|
};
|
||||||
|
ctx.dl()
|
||||||
|
.push_rect_bordered(sel_r, sel_h * 0.5, sel_bg, 1.0, sel_border);
|
||||||
let preset_lbl = active_eq_preset_name(bands, ru);
|
let preset_lbl = active_eq_preset_name(bands, ru);
|
||||||
let label_col = if is_disabled {
|
let label_col = if is_disabled {
|
||||||
pal.text_disabled
|
pal.text_disabled
|
||||||
} else {
|
} else {
|
||||||
pal.text_bright
|
pal.text_bright
|
||||||
}
|
}
|
||||||
.with_alpha_f32(content_alpha);
|
.scale_alpha(content_alpha);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
preset_lbl,
|
preset_lbl,
|
||||||
TextStyle::medium(13.5, label_col),
|
TextStyle::bold(13.5, label_col),
|
||||||
Rect::from_xywh(sel_r.left() + 18.0, sel_r.top(), sel_r.width() - 48.0, sel_r.height()),
|
Rect::from_xywh(sel_r.left() + 18.0, sel_r.top(), sel_r.width() - 46.0, sel_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
ctx.draw_icon(
|
ctx.draw_icon(
|
||||||
|
|
@ -4319,7 +4328,7 @@ fn render_equalizer_body(
|
||||||
} else {
|
} else {
|
||||||
pal.text_bright
|
pal.text_bright
|
||||||
}
|
}
|
||||||
.with_alpha_f32(content_alpha),
|
.scale_alpha(content_alpha),
|
||||||
);
|
);
|
||||||
if sel_resp.hovered {
|
if sel_resp.hovered {
|
||||||
ctx.set_cursor(CursorKind::Pointer);
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
|
|
@ -4451,20 +4460,20 @@ pub fn render_shortcuts_modal(
|
||||||
32.0,
|
32.0,
|
||||||
0.0,
|
0.0,
|
||||||
Vec2::new(0.0, 8.0),
|
Vec2::new(0.0, 8.0),
|
||||||
pal.shadow_modal.with_alpha_f32(alpha),
|
pal.shadow_modal.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
ctx.dl().push_rect_bordered(
|
ctx.dl().push_rect_bordered(
|
||||||
modal_r,
|
modal_r,
|
||||||
16.0,
|
16.0,
|
||||||
pal.bg_popover.with_alpha_f32(alpha),
|
pal.bg_popover.scale_alpha(alpha),
|
||||||
1.0,
|
1.0,
|
||||||
pal.border_subtle.with_alpha_f32(alpha),
|
pal.border_subtle.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
|
|
||||||
let hdr_r = Rect::from_xywh(modal_r.left() + 20.0, modal_r.top() + 18.0, modal_w - 40.0, 32.0);
|
let hdr_r = Rect::from_xywh(modal_r.left() + 20.0, modal_r.top() + 18.0, modal_w - 40.0, 32.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
if ru { "Горячие клавиши" } else { "Hot keys" },
|
if ru { "Горячие клавиши" } else { "Hot keys" },
|
||||||
TextStyle::headline(20.0, pal.text_bright.with_alpha_f32(alpha)),
|
TextStyle::headline(20.0, pal.text_bright.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
|
|
@ -4794,21 +4803,21 @@ pub fn render_release_notes_modal(
|
||||||
32.0,
|
32.0,
|
||||||
0.0,
|
0.0,
|
||||||
Vec2::new(0.0, 8.0),
|
Vec2::new(0.0, 8.0),
|
||||||
pal.shadow_modal.with_alpha_f32(alpha),
|
pal.shadow_modal.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
ctx.dl().push_rect_bordered(
|
ctx.dl().push_rect_bordered(
|
||||||
modal_r,
|
modal_r,
|
||||||
16.0,
|
16.0,
|
||||||
pal.bg_popover.with_alpha_f32(alpha),
|
pal.bg_popover.scale_alpha(alpha),
|
||||||
1.0,
|
1.0,
|
||||||
pal.border_subtle.with_alpha_f32(alpha),
|
pal.border_subtle.scale_alpha(alpha),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Header (`padding: 16px`, title + circular close ×)
|
// Header (`padding: 16px`, title + circular close ×)
|
||||||
let hdr_r = Rect::from_xywh(modal_r.left() + 20.0, modal_r.top() + 14.0, modal_w - 40.0, 34.0);
|
let hdr_r = Rect::from_xywh(modal_r.left() + 20.0, modal_r.top() + 14.0, modal_w - 40.0, 34.0);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
i18n.whats_new(),
|
i18n.whats_new(),
|
||||||
TextStyle::headline(20.0, pal.text_bright.with_alpha_f32(alpha)),
|
TextStyle::headline(20.0, pal.text_bright.scale_alpha(alpha)),
|
||||||
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
Rect::from_xywh(hdr_r.left(), hdr_r.top(), hdr_r.width() - 36.0, hdr_r.height()),
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::api::models::format_ms;
|
use crate::api::models::format_ms;
|
||||||
use crate::app::{AppAction, AppState, RepeatMode, Route};
|
use crate::app::{AppAction, AppState, RepeatMode, Route};
|
||||||
|
use crate::config::PlayerThumbStyle;
|
||||||
use crate::covers::CoverCache;
|
use crate::covers::CoverCache;
|
||||||
use crate::engine::widgets::{draw_cover_art, separated_artists, ym_volume_capsule};
|
use crate::engine::widgets::{draw_cover_art, separated_artists, ym_volume_capsule};
|
||||||
use crate::engine::{
|
use crate::engine::{
|
||||||
|
|
@ -8,6 +9,7 @@ use crate::engine::{
|
||||||
};
|
};
|
||||||
use crate::icons::Icon;
|
use crate::icons::Icon;
|
||||||
use crate::views::overlays::ShellUiState;
|
use crate::views::overlays::ShellUiState;
|
||||||
|
use crate::views::player_thumbs::render_player_bar_companion;
|
||||||
|
|
||||||
/// Exact Yandex Music Desktop 5.129.0 Bottom PlayerBar (`PlayerBarDesktopWithBackgroundProgressBar`):
|
/// Exact Yandex Music Desktop 5.129.0 Bottom PlayerBar (`PlayerBarDesktopWithBackgroundProgressBar`):
|
||||||
/// - Exact 80px height, `hsl(h, s%, 20%)` track-derived bg (or `pal.bg_player`) in BOTH themes
|
/// - Exact 80px height, `hsl(h, s%, 20%)` track-derived bg (or `pal.bg_player`) in BOTH themes
|
||||||
|
|
@ -86,11 +88,13 @@ pub fn render_player_bar(
|
||||||
|
|
||||||
ctx.dl().push_rect(rect, 12.0, base_bg);
|
ctx.dl().push_rect(rect, 12.0, base_bg);
|
||||||
|
|
||||||
// 2. Top-edge 4px yellow progress bar + 12px thumb + hover timecode pills
|
// 2. Top-edge progress bar (Standard hover yellow bar OR live animated Duck/Car/Claudik/Antigravity/Ferris/Nyan companion!)
|
||||||
let bar_hover_zone = rect.expand2(Vec2::new(0.0, 6.0));
|
let thumb_style = app.config.player_thumb;
|
||||||
|
let is_custom_thumb = thumb_style != PlayerThumbStyle::Standard;
|
||||||
|
let bar_hover_zone = rect.expand2(Vec2::new(0.0, if is_custom_thumb { 20.0 } else { 6.0 }));
|
||||||
let bar_hovered = ctx.is_hovered(bar_hover_zone);
|
let bar_hovered = ctx.is_hovered(bar_hover_zone);
|
||||||
let scrub_zone = Rect::from_min_max(
|
let scrub_zone = Rect::from_min_max(
|
||||||
Pos2::new(rect.left() + 8.0, rect.top() - 6.0),
|
Pos2::new(rect.left() + 8.0, rect.top() - if is_custom_thumb { 22.0 } else { 6.0 }),
|
||||||
Pos2::new(rect.right() - 8.0, rect.top() + 12.0),
|
Pos2::new(rect.right() - 8.0, rect.top() + 12.0),
|
||||||
);
|
);
|
||||||
let scrub_resp = ctx.interact(WidgetId::new("pb_top_scrub"), scrub_zone);
|
let scrub_resp = ctx.interact(WidgetId::new("pb_top_scrub"), scrub_zone);
|
||||||
|
|
@ -136,65 +140,84 @@ pub fn render_player_bar(
|
||||||
scrub_resp.hovered || scrub_resp.pressed || scrub_resp.dragged || shell.pb_scrub_frac.is_some();
|
scrub_resp.hovered || scrub_resp.pressed || scrub_resp.dragged || shell.pb_scrub_frac.is_some();
|
||||||
let hover_t = ctx.animate_bool(WidgetId::new("pb_scrub_hover_anim"), bar_hovered || scrub_active, 0.15);
|
let hover_t = ctx.animate_bool(WidgetId::new("pb_scrub_hover_anim"), bar_hovered || scrub_active, 0.15);
|
||||||
|
|
||||||
if hover_t > 0.01 {
|
if is_custom_thumb || hover_t > 0.01 {
|
||||||
let display_frac = display_progress;
|
let display_frac = display_progress;
|
||||||
|
|
||||||
ctx.with_layer(ZLayer::Popover, |ctx| {
|
ctx.with_layer(ZLayer::Popover, |ctx| {
|
||||||
let bar_y = rect.top() + 2.0;
|
let bar_y = rect.top() + 2.0;
|
||||||
let bar_r = Rect::from_min_max(
|
if is_custom_thumb {
|
||||||
Pos2::new(scrub_zone.left(), bar_y - 2.0),
|
let anim_time = app.fixed_vibe_time.unwrap_or(ctx.input.time as f32);
|
||||||
Pos2::new(scrub_zone.right(), bar_y + 2.0),
|
render_player_bar_companion(
|
||||||
);
|
ctx,
|
||||||
ctx.dl()
|
pal,
|
||||||
.push_rect(bar_r, 2.0, css_rgba(255, 255, 255, (38.0 * hover_t).round() as u8));
|
thumb_style,
|
||||||
|
scrub_zone.left(),
|
||||||
|
scrub_zone.right(),
|
||||||
|
bar_y,
|
||||||
|
display_frac,
|
||||||
|
is_playing,
|
||||||
|
anim_time,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
let bar_r = Rect::from_min_max(
|
||||||
|
Pos2::new(scrub_zone.left(), bar_y - 2.0),
|
||||||
|
Pos2::new(scrub_zone.right(), bar_y + 2.0),
|
||||||
|
);
|
||||||
|
ctx.dl()
|
||||||
|
.push_rect(bar_r, 2.0, css_rgba(255, 255, 255, (38.0 * hover_t).round() as u8));
|
||||||
|
|
||||||
let fill_x = scrub_zone.left() + scrub_zone.width() * display_frac;
|
let fill_x = scrub_zone.left() + scrub_zone.width() * display_frac;
|
||||||
let fill_r = Rect::from_min_max(bar_r.min(), Pos2::new(fill_x, bar_r.bottom()));
|
let fill_r = Rect::from_min_max(bar_r.min(), Pos2::new(fill_x, bar_r.bottom()));
|
||||||
let yellow_a = pal.yellow.with_alpha_f32(hover_t);
|
let yellow_a = pal.yellow.with_alpha_f32(hover_t);
|
||||||
ctx.dl().push_rect(fill_r, 2.0, yellow_a);
|
ctx.dl().push_rect(fill_r, 2.0, yellow_a);
|
||||||
|
|
||||||
// Exact 12px circular yellow thumb (`radius = 6px`)
|
// Exact 12px circular yellow thumb (`radius = 6px`)
|
||||||
ctx.dl()
|
ctx.dl()
|
||||||
.push_circle(Pos2::new(fill_x, bar_y), 6.0 * hover_t, yellow_a);
|
.push_circle(Pos2::new(fill_x, bar_y), 6.0 * hover_t, yellow_a);
|
||||||
|
}
|
||||||
|
|
||||||
// Left & right timecode pills
|
if hover_t > 0.01 {
|
||||||
let cur_ms = (display_frac * duration_ms as f32) as u64;
|
// Left & right timecode pills (lifted cleanly above custom companions)
|
||||||
let tc_bg = css_rgba(20, 20, 20, (215.0 * hover_t).round() as u8);
|
let cur_ms = (display_frac * duration_ms as f32) as u64;
|
||||||
let tc_fg = Color::rgb(0xE6, 0xE6, 0xE6).with_alpha_f32(hover_t);
|
let tc_bg = css_rgba(20, 20, 20, (215.0 * hover_t).round() as u8);
|
||||||
|
let tc_fg = Color::rgb(0xE6, 0xE6, 0xE6).with_alpha_f32(hover_t);
|
||||||
|
let tc_y = rect.top() - if is_custom_thumb { 36.0 } else { 24.0 };
|
||||||
|
|
||||||
let left_tc_r = Rect::from_xywh(rect.left() + 8.0, rect.top() - 24.0, 44.0, 18.0);
|
let left_tc_r = Rect::from_xywh(rect.left() + 8.0, tc_y, 44.0, 18.0);
|
||||||
ctx.dl().push_rect(left_tc_r, 9.0, tc_bg);
|
ctx.dl().push_rect(left_tc_r, 9.0, tc_bg);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
&format_ms(cur_ms),
|
&format_ms(cur_ms),
|
||||||
TextStyle::medium(11.0, tc_fg),
|
TextStyle::medium(11.0, tc_fg),
|
||||||
left_tc_r,
|
left_tc_r,
|
||||||
TextAlign::Center,
|
TextAlign::Center,
|
||||||
);
|
);
|
||||||
|
|
||||||
let right_tc_r = Rect::from_xywh(rect.right() - 52.0, rect.top() - 24.0, 44.0, 18.0);
|
let right_tc_r = Rect::from_xywh(rect.right() - 52.0, tc_y, 44.0, 18.0);
|
||||||
ctx.dl().push_rect(right_tc_r, 9.0, tc_bg);
|
ctx.dl().push_rect(right_tc_r, 9.0, tc_bg);
|
||||||
ctx.draw_text_ellipsis(
|
ctx.draw_text_ellipsis(
|
||||||
&format_ms(duration_ms),
|
&format_ms(duration_ms),
|
||||||
TextStyle::medium(11.0, tc_fg),
|
TextStyle::medium(11.0, tc_fg),
|
||||||
right_tc_r,
|
right_tc_r,
|
||||||
TextAlign::Center,
|
TextAlign::Center,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Hover seek cursor timecode tooltip
|
// Hover seek cursor timecode tooltip
|
||||||
if scrub_active {
|
if scrub_active {
|
||||||
ctx.set_cursor(CursorKind::Pointer);
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
if let Some(pos) = ctx.input.pointer_pos {
|
if let Some(pos) = ctx.input.pointer_pos {
|
||||||
let frac = ((pos.x - scrub_zone.left()) / scrub_zone.width().max(1.0)).clamp(0.0, 1.0);
|
let frac = ((pos.x - scrub_zone.left()) / scrub_zone.width().max(1.0)).clamp(0.0, 1.0);
|
||||||
let hover_ms = (frac * duration_ms as f32) as u64;
|
let hover_ms = (frac * duration_ms as f32) as u64;
|
||||||
let tip_x = pos.x.clamp(rect.left() + 78.0, (rect.right() - 78.0).max(rect.left() + 78.0));
|
let tip_x = pos.x.clamp(rect.left() + 78.0, (rect.right() - 78.0).max(rect.left() + 78.0));
|
||||||
let tip_r = Rect::from_center_size(Pos2::new(tip_x, rect.top() - 18.0), Vec2::new(50.0, 22.0));
|
let tip_y = rect.top() - if is_custom_thumb { 32.0 } else { 18.0 };
|
||||||
ctx.dl().push_rect(tip_r, 11.0, css_rgba(20, 20, 20, 230));
|
let tip_r = Rect::from_center_size(Pos2::new(tip_x, tip_y), Vec2::new(50.0, 22.0));
|
||||||
ctx.draw_text_ellipsis(
|
ctx.dl().push_rect(tip_r, 11.0, css_rgba(20, 20, 20, 230));
|
||||||
&format_ms(hover_ms),
|
ctx.draw_text_ellipsis(
|
||||||
TextStyle::medium(12.0, Color::WHITE),
|
&format_ms(hover_ms),
|
||||||
tip_r,
|
TextStyle::medium(12.0, Color::WHITE),
|
||||||
TextAlign::Center,
|
tip_r,
|
||||||
);
|
TextAlign::Center,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -501,9 +524,7 @@ pub fn render_player_bar(
|
||||||
ctx.draw_icon(
|
ctx.draw_icon(
|
||||||
if is_liked { Icon::Liked } else { Icon::Like },
|
if is_liked { Icon::Liked } else { Icon::Like },
|
||||||
Rect::from_center_size(like_r.center(), Vec2::splat(24.0)),
|
Rect::from_center_size(like_r.center(), Vec2::splat(24.0)),
|
||||||
if is_liked {
|
if is_liked || like_resp.hovered {
|
||||||
pal.accent_coral
|
|
||||||
} else if like_resp.hovered {
|
|
||||||
fg_bright
|
fg_bright
|
||||||
} else {
|
} else {
|
||||||
fg_muted
|
fg_muted
|
||||||
|
|
|
||||||
385
src/views/player_thumbs.rs
Normal file
385
src/views/player_thumbs.rs
Normal file
|
|
@ -0,0 +1,385 @@
|
||||||
|
use crate::config::PlayerThumbStyle;
|
||||||
|
use crate::engine::theme::YmPalette;
|
||||||
|
use crate::engine::types::{Color, Pos2, Rect, Vec2};
|
||||||
|
use crate::engine::{css_rgba, UiContext};
|
||||||
|
use crate::icons::Icon;
|
||||||
|
|
||||||
|
/// Draws the progress trail + live animated companion on the top edge of `PlayerBar`.
|
||||||
|
/// Called only when `style != PlayerThumbStyle::Standard`.
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
pub fn render_player_bar_companion(
|
||||||
|
ctx: &mut UiContext,
|
||||||
|
pal: &YmPalette,
|
||||||
|
style: PlayerThumbStyle,
|
||||||
|
bar_left: f32,
|
||||||
|
bar_right: f32,
|
||||||
|
bar_y: f32,
|
||||||
|
progress: f32,
|
||||||
|
playing: bool,
|
||||||
|
time: f32,
|
||||||
|
) {
|
||||||
|
let frac = progress.clamp(0.0, 1.0);
|
||||||
|
let track_w = (bar_right - bar_left).max(1.0);
|
||||||
|
let fill_x = bar_left + track_w * frac;
|
||||||
|
let anim_t = if playing { time } else { 0.0 };
|
||||||
|
|
||||||
|
// Subtle base track along top edge
|
||||||
|
let track_r = Rect::from_xywh(bar_left, bar_y - 1.5, track_w, 3.0);
|
||||||
|
ctx.dl().push_rect(track_r, 1.5, css_rgba(255, 255, 255, 34));
|
||||||
|
|
||||||
|
// Themed progress trail behind the companion
|
||||||
|
let fill_w = (fill_x - bar_left).max(0.0);
|
||||||
|
if fill_w > 1.0 {
|
||||||
|
match style {
|
||||||
|
PlayerThumbStyle::Standard => {}
|
||||||
|
PlayerThumbStyle::Duck => {
|
||||||
|
ctx.dl()
|
||||||
|
.push_rect(Rect::from_xywh(bar_left, bar_y - 1.5, fill_w, 3.0), 1.5, pal.yellow);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Car => {
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(bar_left, bar_y - 1.5, fill_w, 3.0),
|
||||||
|
1.5,
|
||||||
|
Color::rgb(0xE8, 0x22, 0x38),
|
||||||
|
);
|
||||||
|
// Tiny drifting exhaust puffs while driving
|
||||||
|
if playing && fill_w > 48.0 {
|
||||||
|
for k in 0..3 {
|
||||||
|
let phase = ((anim_t * 2.4 + k as f32 * 0.33) % 1.0).clamp(0.0, 1.0);
|
||||||
|
let px = fill_x - 30.0 - phase * 24.0;
|
||||||
|
let py = bar_y - 5.0 - phase * 6.0;
|
||||||
|
let a = ((1.0 - phase) * 90.0).round() as u8;
|
||||||
|
if px > bar_left {
|
||||||
|
ctx.dl()
|
||||||
|
.push_circle(Pos2::new(px, py), 2.0 + phase * 2.5, css_rgba(220, 224, 232, a));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Claudik => {
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(bar_left, bar_y - 1.5, fill_w, 3.0),
|
||||||
|
1.5,
|
||||||
|
Color::rgb(0xD9, 0x77, 0x57),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Antigravity => {
|
||||||
|
ctx.dl().push_gradient_rect(
|
||||||
|
Rect::from_xywh(bar_left, bar_y - 1.5, fill_w, 3.0),
|
||||||
|
1.5,
|
||||||
|
Color::rgb(0x9B, 0x84, 0xEC),
|
||||||
|
Color::rgb(0x52, 0xB6, 0xFF),
|
||||||
|
Vec2::new(1.0, 0.0),
|
||||||
|
);
|
||||||
|
// Twinkling cosmic star dust trailing behind Antigravity
|
||||||
|
let count = ((fill_w / 22.0) as usize).min(6);
|
||||||
|
for k in 0..count {
|
||||||
|
let phase = ((anim_t * 1.6 + k as f32 * 0.27) % 1.0).clamp(0.0, 1.0);
|
||||||
|
let sx = fill_x - 16.0 - k as f32 * 18.0 - phase * 10.0;
|
||||||
|
let sy = bar_y - 6.0 - ((k as f32 * 1.9 + anim_t * 3.0).sin() * 4.5).abs();
|
||||||
|
let twinkle = 0.35 + 0.65 * ((anim_t * 5.0 + k as f32 * 1.7).sin() * 0.5 + 0.5);
|
||||||
|
if sx > bar_left + 4.0 {
|
||||||
|
let col = if k % 2 == 0 {
|
||||||
|
Color::rgb(0x9B, 0x84, 0xEC).scale_alpha(twinkle * 0.85)
|
||||||
|
} else {
|
||||||
|
Color::rgb(0x6C, 0xD4, 0xFF).scale_alpha(twinkle * 0.85)
|
||||||
|
};
|
||||||
|
ctx.dl().push_rect(Rect::from_xywh(sx.round(), sy.round(), 2.0, 2.0), 0.0, col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Ferris => {
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(bar_left, bar_y - 1.5, fill_w, 3.0),
|
||||||
|
1.5,
|
||||||
|
Color::rgb(0xF7, 0x4C, 0x00),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Nyan => {
|
||||||
|
// Classic 6-stripe waving pixel rainbow trail!
|
||||||
|
let stripes = [
|
||||||
|
Color::rgb(0xFF, 0x26, 0x26),
|
||||||
|
Color::rgb(0xFF, 0x99, 0x00),
|
||||||
|
Color::rgb(0xFF, 0xEE, 0x00),
|
||||||
|
Color::rgb(0x33, 0xDD, 0x33),
|
||||||
|
Color::rgb(0x1E, 0x9E, 0xFF),
|
||||||
|
Color::rgb(0x7A, 0x44, 0xFF),
|
||||||
|
];
|
||||||
|
let seg_w = 10.0f32;
|
||||||
|
let max_trail = (fill_w - 6.0).max(0.0);
|
||||||
|
let num_segs = (max_trail / seg_w).ceil() as usize;
|
||||||
|
let wave_step = (anim_t * 8.0).floor() as i32;
|
||||||
|
for s in 0..num_segs {
|
||||||
|
let sx = bar_left + s as f32 * seg_w;
|
||||||
|
let sw = (fill_x - 6.0 - sx).min(seg_w);
|
||||||
|
if sw <= 0.5 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
let dy = if ((s as i32 + wave_step) & 1) == 0 { -1.0 } else { 1.0 };
|
||||||
|
for (ci, &col) in stripes.iter().enumerate() {
|
||||||
|
let sy = bar_y - 11.0 + ci as f32 * 2.0 + dy;
|
||||||
|
ctx.dl()
|
||||||
|
.push_rect(Rect::from_xywh(sx, sy, sw + 0.5, 2.0), 0.0, col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw the companion anchored cleanly at `(fill_x, bar_y)`
|
||||||
|
match style {
|
||||||
|
PlayerThumbStyle::Standard => {}
|
||||||
|
PlayerThumbStyle::Duck => {
|
||||||
|
let bob = if playing { (anim_t * 9.0).sin().abs() * -2.0 } else { 0.0 };
|
||||||
|
let sz = 32.0;
|
||||||
|
let r = Rect::from_xywh(fill_x - sz * 0.5, bar_y - sz + 3.0 + bob, sz, sz);
|
||||||
|
ctx.draw_icon(Icon::ThumbDuck, r, Color::WHITE);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Car => {
|
||||||
|
let vib = if playing { (anim_t * 28.0).sin() * 0.6 } else { 0.0 };
|
||||||
|
let w = 68.0;
|
||||||
|
let h = 21.0;
|
||||||
|
let r = Rect::from_xywh(fill_x - w * 0.52, bar_y - h + 2.0 + vib, w, h);
|
||||||
|
// Warm headlight beam ahead of the car when playing
|
||||||
|
if playing && r.right() < bar_right {
|
||||||
|
let beam_w = (bar_right - r.right()).min(26.0);
|
||||||
|
ctx.dl().push_gradient_rect(
|
||||||
|
Rect::from_xywh(r.right() - 2.0, bar_y - 10.0 + vib, beam_w, 8.0),
|
||||||
|
2.0,
|
||||||
|
css_rgba(255, 240, 160, 95),
|
||||||
|
css_rgba(255, 240, 160, 0),
|
||||||
|
Vec2::new(1.0, 0.0),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
ctx.draw_icon(Icon::ThumbCar, r, Color::WHITE);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Claudik => {
|
||||||
|
let step = if playing { ((anim_t * 7.0).floor() as u32) & 1 } else { 0 };
|
||||||
|
let bob = if playing && step == 1 { -1.5 } else { 0.0 };
|
||||||
|
draw_claudik_sprite(ctx, Pos2::new(fill_x, bar_y + bob), 2.5, step == 1);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Antigravity => {
|
||||||
|
let hover = if playing { (anim_t * 4.5).sin() * 2.2 - 3.5 } else { -2.5 };
|
||||||
|
draw_antigravity_sprite(ctx, Pos2::new(fill_x, bar_y + hover), 2.5, anim_t, true);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Ferris => {
|
||||||
|
let step = if playing { ((anim_t * 8.0).floor() as u32) & 1 } else { 0 };
|
||||||
|
let bob = if playing && step == 1 { -1.0 } else { 0.0 };
|
||||||
|
draw_ferris_sprite(ctx, Pos2::new(fill_x, bar_y + bob), 2.2, step == 1);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Nyan => {
|
||||||
|
let step = if playing { ((anim_t * 9.0).floor() as u32) & 1 } else { 0 };
|
||||||
|
let bob = if playing && step == 1 { -1.5 } else { 0.0 };
|
||||||
|
draw_nyan_sprite(ctx, Pos2::new(fill_x, bar_y + bob), 2.0, step == 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Draws the centered preview inside Settings -> «Вид плеера» card (`preview_r`).
|
||||||
|
pub fn render_thumb_preview(
|
||||||
|
ctx: &mut UiContext,
|
||||||
|
pal: &YmPalette,
|
||||||
|
style: PlayerThumbStyle,
|
||||||
|
preview_r: Rect,
|
||||||
|
time: f32,
|
||||||
|
) {
|
||||||
|
let cx = preview_r.center_x();
|
||||||
|
let cy = preview_r.center_y();
|
||||||
|
match style {
|
||||||
|
PlayerThumbStyle::Standard => {
|
||||||
|
let bar_w = 60.0;
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_center_size(Pos2::new(cx, cy), Vec2::new(bar_w, 5.0)),
|
||||||
|
2.5,
|
||||||
|
pal.border_control,
|
||||||
|
);
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(cx - bar_w * 0.5, cy - 2.5, bar_w * 0.52, 5.0),
|
||||||
|
2.5,
|
||||||
|
pal.yellow,
|
||||||
|
);
|
||||||
|
ctx.dl().push_circle(Pos2::new(cx, cy), 10.0, pal.yellow);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Duck => {
|
||||||
|
ctx.draw_icon(
|
||||||
|
Icon::ThumbDuck,
|
||||||
|
Rect::from_center_size(Pos2::new(cx, cy + 2.0), Vec2::splat(48.0)),
|
||||||
|
Color::WHITE,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Car => {
|
||||||
|
ctx.draw_icon(
|
||||||
|
Icon::ThumbCar,
|
||||||
|
Rect::from_center_size(Pos2::new(cx, cy + 4.0), Vec2::new(82.0, 26.0)),
|
||||||
|
Color::WHITE,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Claudik => {
|
||||||
|
draw_claudik_sprite(ctx, Pos2::new(cx, cy + 16.0), 3.6, false);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Antigravity => {
|
||||||
|
draw_antigravity_sprite(ctx, Pos2::new(cx - 2.0, cy + 16.0), 3.5, time, true);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Ferris => {
|
||||||
|
draw_ferris_sprite(ctx, Pos2::new(cx, cy + 15.0), 3.2, false);
|
||||||
|
}
|
||||||
|
PlayerThumbStyle::Nyan => {
|
||||||
|
// Mini rainbow preview behind Nyan Cat
|
||||||
|
let stripes = [
|
||||||
|
Color::rgb(0xFF, 0x26, 0x26),
|
||||||
|
Color::rgb(0xFF, 0x99, 0x00),
|
||||||
|
Color::rgb(0xFF, 0xEE, 0x00),
|
||||||
|
Color::rgb(0x33, 0xDD, 0x33),
|
||||||
|
Color::rgb(0x1E, 0x9E, 0xFF),
|
||||||
|
Color::rgb(0x7A, 0x44, 0xFF),
|
||||||
|
];
|
||||||
|
for (ci, &col) in stripes.iter().enumerate() {
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(cx - 40.0, cy - 8.0 + ci as f32 * 2.5, 24.0, 2.5),
|
||||||
|
0.0,
|
||||||
|
col,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
draw_nyan_sprite(ctx, Pos2::new(cx + 8.0, cy + 12.0), 2.7, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Crisp pixel helper anchored at bottom-center `origin`, unit size `p` logical px.
|
||||||
|
#[inline]
|
||||||
|
fn px_rect(ctx: &mut UiContext, origin: Pos2, p: f32, gx: f32, gy: f32, gw: f32, gh: f32, col: Color) {
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh(
|
||||||
|
(origin.x + gx * p).round(),
|
||||||
|
(origin.y - gy * p).round(),
|
||||||
|
(gw * p).round().max(1.0),
|
||||||
|
(gh * p).round().max(1.0),
|
||||||
|
),
|
||||||
|
0.0,
|
||||||
|
col,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Pixel-art Claudik (Claude Code terracotta buddy `#D97757`, matching user's reference!).
|
||||||
|
fn draw_claudik_sprite(ctx: &mut UiContext, origin: Pos2, p: f32, alt_step: bool) {
|
||||||
|
let body = Color::rgb(0xD9, 0x77, 0x57);
|
||||||
|
let eye = Color::rgb(0x1B, 0x1D, 0x24);
|
||||||
|
// Main blocky head/body (10×6 pixels)
|
||||||
|
px_rect(ctx, origin, p, -5.0, 8.0, 10.0, 6.0, body);
|
||||||
|
// Little side pixel arms
|
||||||
|
let arm_y = if alt_step { 4.5 } else { 4.0 };
|
||||||
|
px_rect(ctx, origin, p, -6.5, arm_y, 1.5, 1.5, body);
|
||||||
|
px_rect(ctx, origin, p, 5.0, arm_y, 1.5, 1.5, body);
|
||||||
|
// Vertical dark eyes
|
||||||
|
px_rect(ctx, origin, p, -3.0, 6.5, 1.0, 2.0, eye);
|
||||||
|
px_rect(ctx, origin, p, 2.0, 6.5, 1.0, 2.0, eye);
|
||||||
|
// 4 cute little legs with walk alternation
|
||||||
|
let (l1, l2) = if alt_step { (1.4, 2.0) } else { (2.0, 1.4) };
|
||||||
|
px_rect(ctx, origin, p, -4.0, 2.0, 1.0, l1, body);
|
||||||
|
px_rect(ctx, origin, p, -2.0, 2.0, 1.0, l2, body);
|
||||||
|
px_rect(ctx, origin, p, 1.0, 2.0, 1.0, l1, body);
|
||||||
|
px_rect(ctx, origin, p, 3.0, 2.0, 1.0, l2, body);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Pixel-art Antigravity cosmic violet cat-bot (`#9B84EC`) + tiny succulent pot & floating aura!
|
||||||
|
fn draw_antigravity_sprite(ctx: &mut UiContext, origin: Pos2, p: f32, time: f32, with_plant: bool) {
|
||||||
|
let body = Color::rgb(0x9B, 0x84, 0xEC);
|
||||||
|
let hi = Color::rgb(0xC2, 0xB3, 0xFF);
|
||||||
|
let eye = Color::rgb(0x17, 0x18, 0x22);
|
||||||
|
// Soft cyan-violet anti-gravity glow underneath
|
||||||
|
let pulse = 0.55 + 0.35 * (time * 4.5).sin();
|
||||||
|
ctx.dl().push_rect(
|
||||||
|
Rect::from_xywh((origin.x - 4.0 * p).round(), (origin.y + 0.5 * p).round(), (8.0 * p).round(), (1.0 * p).round().max(2.0)),
|
||||||
|
2.0,
|
||||||
|
Color::rgb(0x52, 0xB6, 0xFF).scale_alpha(pulse * 0.65),
|
||||||
|
);
|
||||||
|
// Pointed cat ears
|
||||||
|
px_rect(ctx, origin, p, -5.0, 9.5, 1.5, 2.0, body);
|
||||||
|
px_rect(ctx, origin, p, -3.5, 8.5, 1.0, 1.0, body);
|
||||||
|
px_rect(ctx, origin, p, 3.5, 9.5, 1.5, 2.0, body);
|
||||||
|
px_rect(ctx, origin, p, 2.5, 8.5, 1.0, 1.0, body);
|
||||||
|
// Main body
|
||||||
|
px_rect(ctx, origin, p, -5.0, 7.5, 10.0, 5.5, body);
|
||||||
|
// Subtle top sheen
|
||||||
|
px_rect(ctx, origin, p, -2.5, 7.5, 5.0, 0.8, hi);
|
||||||
|
// Dark pixel eyes with tiny sparkle
|
||||||
|
px_rect(ctx, origin, p, -3.0, 6.0, 1.2, 2.0, eye);
|
||||||
|
px_rect(ctx, origin, p, 1.8, 6.0, 1.2, 2.0, eye);
|
||||||
|
// 4 floating legs
|
||||||
|
px_rect(ctx, origin, p, -4.0, 2.0, 1.0, 1.8, body);
|
||||||
|
px_rect(ctx, origin, p, -2.0, 2.0, 1.0, 1.8, body);
|
||||||
|
px_rect(ctx, origin, p, 1.0, 2.0, 1.0, 1.8, body);
|
||||||
|
px_rect(ctx, origin, p, 3.0, 2.0, 1.0, 1.8, body);
|
||||||
|
// Cute tiny potted cactus/succulent friend on the right (matching Screenshot 3!)
|
||||||
|
if with_plant {
|
||||||
|
px_rect(ctx, origin, p, 5.2, 1.8, 3.2, 1.2, Color::rgb(0x8D, 0x55, 0x2B));
|
||||||
|
px_rect(ctx, origin, p, 5.7, 0.8, 2.2, 0.8, Color::rgb(0x6E, 0x40, 0x1E));
|
||||||
|
px_rect(ctx, origin, p, 6.2, 4.4, 1.2, 2.6, Color::rgb(0x6D, 0xE8, 0x7A));
|
||||||
|
px_rect(ctx, origin, p, 7.6, 3.2, 0.9, 1.4, Color::rgb(0x52, 0xC9, 0x60));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Pixel-art Ferris the Rust Crab (`#F74C00`) scuttling along the progress bar!
|
||||||
|
fn draw_ferris_sprite(ctx: &mut UiContext, origin: Pos2, p: f32, alt_step: bool) {
|
||||||
|
let shell = Color::rgb(0xF7, 0x4C, 0x00);
|
||||||
|
let dark = Color::rgb(0xC2, 0x35, 0x00);
|
||||||
|
let white = Color::WHITE;
|
||||||
|
let pupil = Color::rgb(0x16, 0x16, 0x1A);
|
||||||
|
// Raised crab claws
|
||||||
|
let claw_dy = if alt_step { 0.7 } else { 0.0 };
|
||||||
|
px_rect(ctx, origin, p, -7.2, 7.5 + claw_dy, 2.2, 2.4, shell);
|
||||||
|
px_rect(ctx, origin, p, 5.0, 7.5 + claw_dy, 2.2, 2.4, shell);
|
||||||
|
px_rect(ctx, origin, p, -6.5, 5.2, 1.8, 1.4, dark);
|
||||||
|
px_rect(ctx, origin, p, 4.7, 5.2, 1.8, 1.4, dark);
|
||||||
|
// Spiky rounded crab carapace
|
||||||
|
px_rect(ctx, origin, p, -5.0, 7.2, 10.0, 5.0, shell);
|
||||||
|
px_rect(ctx, origin, p, -3.5, 8.2, 7.0, 1.2, shell);
|
||||||
|
// Googly eyes
|
||||||
|
px_rect(ctx, origin, p, -3.0, 6.0, 2.0, 2.0, white);
|
||||||
|
px_rect(ctx, origin, p, 1.0, 6.0, 2.0, 2.0, white);
|
||||||
|
px_rect(ctx, origin, p, -2.0, 5.5, 1.0, 1.2, pupil);
|
||||||
|
px_rect(ctx, origin, p, 2.0, 5.5, 1.0, 1.2, pupil);
|
||||||
|
// Cute smile
|
||||||
|
px_rect(ctx, origin, p, -1.0, 3.4, 2.0, 0.8, dark);
|
||||||
|
// Scuttling legs
|
||||||
|
let off = if alt_step { 0.5 } else { 0.0 };
|
||||||
|
px_rect(ctx, origin, p, -4.5 + off, 2.2, 1.2, 2.0, dark);
|
||||||
|
px_rect(ctx, origin, p, -2.0 - off, 2.2, 1.2, 2.0, dark);
|
||||||
|
px_rect(ctx, origin, p, 0.8 + off, 2.2, 1.2, 2.0, dark);
|
||||||
|
px_rect(ctx, origin, p, 3.3 - off, 2.2, 1.2, 2.0, dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Pixel-art Nyan Cat zooming along the rainbow progress bar!
|
||||||
|
fn draw_nyan_sprite(ctx: &mut UiContext, origin: Pos2, p: f32, alt_step: bool) {
|
||||||
|
let crust = Color::rgb(0xF6, 0xCC, 0x8F);
|
||||||
|
let icing = Color::rgb(0xFF, 0x99, 0xD6);
|
||||||
|
let sprinkle = Color::rgb(0xFF, 0x33, 0x88);
|
||||||
|
let cat = Color::rgb(0x9A, 0x9E, 0xA8);
|
||||||
|
let dark = Color::rgb(0x1C, 0x1E, 0x24);
|
||||||
|
let blush = Color::rgb(0xFF, 0x85, 0xA1);
|
||||||
|
// Tail wagging on left
|
||||||
|
let ty = if alt_step { 6.2 } else { 4.8 };
|
||||||
|
px_rect(ctx, origin, p, -8.0, ty, 2.5, 1.4, cat);
|
||||||
|
// Pop-tart body
|
||||||
|
px_rect(ctx, origin, p, -5.8, 8.6, 8.8, 6.8, crust);
|
||||||
|
px_rect(ctx, origin, p, -4.8, 7.6, 6.8, 4.8, icing);
|
||||||
|
// Sprinkles
|
||||||
|
px_rect(ctx, origin, p, -3.8, 6.6, 1.0, 1.0, sprinkle);
|
||||||
|
px_rect(ctx, origin, p, -1.5, 5.4, 1.0, 1.0, sprinkle);
|
||||||
|
px_rect(ctx, origin, p, 0.2, 6.8, 1.0, 1.0, sprinkle);
|
||||||
|
// Cat head on right
|
||||||
|
px_rect(ctx, origin, p, 1.2, 7.8, 5.4, 4.8, cat);
|
||||||
|
px_rect(ctx, origin, p, 1.5, 9.2, 1.5, 1.5, cat);
|
||||||
|
px_rect(ctx, origin, p, 4.8, 9.2, 1.5, 1.5, cat);
|
||||||
|
// Eyes & blush
|
||||||
|
px_rect(ctx, origin, p, 2.4, 6.4, 1.0, 1.2, dark);
|
||||||
|
px_rect(ctx, origin, p, 4.8, 6.4, 1.0, 1.2, dark);
|
||||||
|
px_rect(ctx, origin, p, 1.8, 5.0, 1.0, 0.9, blush);
|
||||||
|
px_rect(ctx, origin, p, 5.4, 5.0, 1.0, 0.9, blush);
|
||||||
|
// Tiny running paws
|
||||||
|
let paw_dx = if alt_step { 0.8 } else { 0.0 };
|
||||||
|
px_rect(ctx, origin, p, -4.8 + paw_dx, 2.0, 1.5, 1.8, cat);
|
||||||
|
px_rect(ctx, origin, p, -1.8 + paw_dx, 2.0, 1.5, 1.8, cat);
|
||||||
|
px_rect(ctx, origin, p, 1.6 + paw_dx, 2.0, 1.5, 1.8, cat);
|
||||||
|
px_rect(ctx, origin, p, 4.0 + paw_dx, 2.0, 1.5, 1.8, cat);
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::app::i18n::APP_VERSION;
|
use crate::app::i18n::APP_VERSION;
|
||||||
use crate::app::state::{AppAction, AppState};
|
use crate::app::state::{AppAction, AppState};
|
||||||
use crate::config::{AudioQuality, Language, ThemeMode};
|
use crate::config::{AudioQuality, Language, PlayerThumbStyle, ThemeMode};
|
||||||
use crate::covers::CoverCache;
|
use crate::covers::CoverCache;
|
||||||
use crate::engine::input::WidgetId;
|
use crate::engine::input::WidgetId;
|
||||||
use crate::engine::text::{TextAlign, TextStyle};
|
use crate::engine::text::{TextAlign, TextStyle};
|
||||||
|
|
@ -13,6 +13,7 @@ use crate::engine::widgets::{
|
||||||
use crate::engine::UiContext;
|
use crate::engine::UiContext;
|
||||||
use crate::icons::Icon;
|
use crate::icons::Icon;
|
||||||
use crate::views::overlays::ShellUiState;
|
use crate::views::overlays::ShellUiState;
|
||||||
|
use crate::views::player_thumbs::render_thumb_preview;
|
||||||
|
|
||||||
/// 1-to-1 Official Yandex Music Desktop 5.129.0 `SettingsPage` (`Settings_root__FVVrn`, `379bcce309ec9c74.css`):
|
/// 1-to-1 Official Yandex Music Desktop 5.129.0 `SettingsPage` (`Settings_root__FVVrn`, `379bcce309ec9c74.css`):
|
||||||
/// Clean borderless list of `SettingsListButtonItem` (title + description + `arrowRight` chevron)
|
/// Clean borderless list of `SettingsListButtonItem` (title + description + `arrowRight` chevron)
|
||||||
|
|
@ -175,7 +176,58 @@ pub fn render_settings(
|
||||||
y += 18.0;
|
y += 18.0;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// 2. Official Settings List (`Settings_root`, 32px vertical spacing)
|
// 2. Official «Вид плеера» (`branded-player.player-type`) + Fun Companions
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
ctx.draw_text_ellipsis(
|
||||||
|
if ru { "Вид плеера" } else { "Player view" },
|
||||||
|
TextStyle::bold(18.0, pal.text_bright),
|
||||||
|
Rect::from_xywh(x, y, col_w, 24.0),
|
||||||
|
TextAlign::Left,
|
||||||
|
);
|
||||||
|
y += 34.0;
|
||||||
|
|
||||||
|
let gap = 12.0;
|
||||||
|
let cols = 4usize;
|
||||||
|
let card_sz = ((col_w - gap * (cols as f32 - 1.0)) / cols as f32).floor().clamp(88.0, 114.0);
|
||||||
|
let anim_time = ctx.input.time as f32;
|
||||||
|
for (idx, &style) in PlayerThumbStyle::ALL.iter().enumerate() {
|
||||||
|
let col = idx % cols;
|
||||||
|
let row = idx / cols;
|
||||||
|
let cx = x + col as f32 * (card_sz + gap);
|
||||||
|
let cy = y + row as f32 * (card_sz + gap);
|
||||||
|
let card_r = Rect::from_xywh(cx, cy, card_sz, card_sz);
|
||||||
|
let resp = ctx.interact(WidgetId::from_pair("set_thumb_card", idx), card_r);
|
||||||
|
let selected = app.config.player_thumb == style;
|
||||||
|
let bg = if resp.hovered {
|
||||||
|
pal.surface_hover
|
||||||
|
} else {
|
||||||
|
pal.surface_secondary
|
||||||
|
};
|
||||||
|
if selected {
|
||||||
|
ctx.dl().push_rect_bordered(card_r, 16.0, bg, 1.5, pal.yellow);
|
||||||
|
} else {
|
||||||
|
ctx.dl().push_rect(card_r, 16.0, bg);
|
||||||
|
}
|
||||||
|
let preview_r = Rect::from_xywh(card_r.left() + 8.0, card_r.top() + 10.0, card_sz - 16.0, card_sz - 38.0);
|
||||||
|
render_thumb_preview(ctx, pal, style, preview_r, anim_time);
|
||||||
|
ctx.draw_text_ellipsis(
|
||||||
|
style.label(ru),
|
||||||
|
TextStyle::medium(12.5, if selected { pal.text_bright } else { pal.text_secondary }),
|
||||||
|
Rect::from_xywh(card_r.left() + 6.0, card_r.bottom() - 26.0, card_sz - 12.0, 18.0),
|
||||||
|
TextAlign::Center,
|
||||||
|
);
|
||||||
|
if resp.hovered {
|
||||||
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
|
}
|
||||||
|
if resp.clicked && !selected {
|
||||||
|
actions.push(AppAction::SetPlayerThumb(style));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let thumb_rows = (PlayerThumbStyle::ALL.len() + cols - 1) / cols;
|
||||||
|
y += thumb_rows as f32 * (card_sz + gap) + 18.0;
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
// 3. Official Settings List (`Settings_root`, 32px vertical spacing)
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
// 2a. Clear memory (`offline.clear-memory`)
|
// 2a. Clear memory (`offline.clear-memory`)
|
||||||
|
|
@ -712,25 +764,27 @@ fn settings_toggle_item(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let sw_w = 44.0;
|
let sw_w = 32.0;
|
||||||
let sw_h = 24.0;
|
let sw_h = 20.0;
|
||||||
let sw_r = Rect::from_xywh(
|
let sw_r = Rect::from_xywh(
|
||||||
x + w - sw_w,
|
x + w - sw_w,
|
||||||
*y + (row_h - sw_h) * 0.5,
|
*y + (row_h - sw_h) * 0.5,
|
||||||
sw_w,
|
sw_w,
|
||||||
sw_h,
|
sw_h,
|
||||||
);
|
);
|
||||||
let track_col = pal.border_control.lerp(pal.yellow, anim);
|
let track_col = pal.surface_hover.lerp(pal.yellow, anim);
|
||||||
ctx.dl().push_rect(sw_r, sw_h * 0.5, track_col);
|
ctx.dl().push_rect(sw_r, sw_h * 0.5, track_col);
|
||||||
|
|
||||||
let knob_x = sw_r.left() + 12.0 + anim * (sw_w - 24.0);
|
let knob_x = sw_r.left() + 10.0 + anim * 12.0;
|
||||||
let knob_col = if anim > 0.5 {
|
let knob_col = if anim > 0.5 {
|
||||||
pal.on_yellow
|
pal.on_yellow
|
||||||
} else {
|
} else if resp.hovered {
|
||||||
pal.text_bright
|
pal.text_bright
|
||||||
|
} else {
|
||||||
|
pal.text_secondary
|
||||||
};
|
};
|
||||||
ctx.dl()
|
ctx.dl()
|
||||||
.push_circle(Pos2::new(knob_x, sw_r.center_y()), 9.0, knob_col);
|
.push_circle(Pos2::new(knob_x, sw_r.center_y()), 8.0, knob_col);
|
||||||
|
|
||||||
if resp.hovered {
|
if resp.hovered {
|
||||||
ctx.set_cursor(CursorKind::Pointer);
|
ctx.set_cursor(CursorKind::Pointer);
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ pub fn render_sidebar(
|
||||||
if show_labels {
|
if show_labels {
|
||||||
let text_x = item_r.left() + 54.0;
|
let text_x = item_r.left() + 54.0;
|
||||||
let show_more = resp.hovered || menu_open_for_this;
|
let show_more = resp.hovered || menu_open_for_this;
|
||||||
let right_reserve = if show_more { 30.0 } else { 8.0 };
|
let right_reserve = if show_more { 38.0 } else { 10.0 };
|
||||||
let max_tw = (item_r.right() - text_x - right_reserve).max(40.0);
|
let max_tw = (item_r.right() - text_x - right_reserve).max(40.0);
|
||||||
|
|
||||||
let title_col = if is_active {
|
let title_col = if is_active {
|
||||||
|
|
@ -402,16 +402,16 @@ pub fn render_sidebar(
|
||||||
TextAlign::Left,
|
TextAlign::Left,
|
||||||
);
|
);
|
||||||
|
|
||||||
// `•••` menu button on hover or when menu open (available on ALL pinned items, including Liked!)
|
// `•••` menu button on hover or when menu open (12px breathing room from right edge!)
|
||||||
let more_r = Rect::from_center_size(
|
let more_r = Rect::from_center_size(
|
||||||
Pos2::new(item_r.right() - 14.0, item_r.center_y()),
|
Pos2::new(item_r.right() - 20.0, item_r.center_y()),
|
||||||
Vec2::splat(24.0),
|
Vec2::splat(26.0),
|
||||||
);
|
);
|
||||||
let more_resp = ctx.interact(WidgetId::from_pair("sb_pin_more", pi), more_r);
|
let more_resp = ctx.interact(WidgetId::from_pair("sb_pin_more", pi), more_r);
|
||||||
if show_more || more_resp.hovered {
|
if show_more || more_resp.hovered {
|
||||||
ctx.draw_icon(
|
ctx.draw_icon(
|
||||||
Icon::MoreXxs,
|
Icon::MoreXxs,
|
||||||
Rect::from_center_size(more_r.center(), Vec2::splat(20.0)),
|
Rect::from_center_size(more_r.center(), Vec2::splat(18.0)),
|
||||||
if more_resp.hovered || menu_open_for_this {
|
if more_resp.hovered || menu_open_for_this {
|
||||||
pal.text_primary
|
pal.text_primary
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2584,5 +2584,12 @@ fn test_ext_19_official_settings_sound_quality_equalizer_and_shortcuts_modals()
|
||||||
shell.app.shortcuts_modal_open = true;
|
shell.app.shortcuts_modal_open = true;
|
||||||
let img_sc = render_single_frame(&mut vk, &mut shell, 0.048);
|
let img_sc = render_single_frame(&mut vk, &mut shell, 0.048);
|
||||||
assert!(img_sc.width() == NATIVE_W && img_sc.height() == NATIVE_H);
|
assert!(img_sc.width() == NATIVE_W && img_sc.height() == NATIVE_H);
|
||||||
|
|
||||||
|
shell.app.shortcuts_modal_open = false;
|
||||||
|
for &style in yandex_music_rs::config::PlayerThumbStyle::ALL {
|
||||||
|
shell.app.config.player_thumb = style;
|
||||||
|
let img_th = render_single_frame(&mut vk, &mut shell, 0.064);
|
||||||
|
assert!(img_th.width() == NATIVE_W && img_th.height() == NATIVE_H);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue