feat(app-iced): 强调色接线落地(M250 ACCENTWIRE)
appearance.accent_color 此前是死线:配置键、presenter 往返、预设色板都在,但造 tokens 的 唯一入口恒走 DesignTokens::brand(board),用户填了色界面不变。 - theme.rs:Ui::with_accent + accent_scheme(唯一调用 DesignTokens::with_accent 的地方) - app/state/theme.rs:rebuild_ui 三选一(显式强调色 > D38 取色方案 > 出厂板),diag 一行说清是谁生效 - pages/appearance:新增 accent 状态(原文/解析结果/方案/结构化错误)+ 设置页输入行与预设色块; 非法值保持上一次合法值并给出 Short/Long/Digit 三档原因,不静默回退出厂色 - presenter::prefs:AccentChoice::parse 成为唯一解析点,set_accent_checked 交回结构化原因 - app/appearance.rs:persist_appearance 带上 accent_color(此前写不进去),只写上一次合法值 - pages/harness/app.rs:gallery 也能吃 ULL_APPEARANCE_ACCENT,供出图矩阵 - core keys.rs:订正「空 = 出厂 #0078D4;accent 令牌全域生效」这句半真半假的说明 - i18n:强调色 7 条文案(链尾新域,金表只追加) 判据:同一组件(进度条 Primary)在空配置与 #006A5C 下色值不同(App 级 + 令牌级两条); 非法值拿到结构化错误、生效色不回退、不写盘、tokens 仍可构造。
This commit is contained in:
1 parent
4cdb46d2e0
commit
e6b2200360
18 files changed
+787
-38
No files matched your search
@@ -195,8 +195,8 @@ use loader::loader_entries;
|
||||
use logs::logs_entries;
|
||||
use nav::nav_entries;
|
||||
use settings::{
|
||||
settings_ai_entries, settings_appearance_entries, settings_download_entries,
|
||||
settings_general_entries, settings_java_entries,
|
||||
settings_accent_entries, settings_ai_entries, settings_appearance_entries,
|
||||
settings_download_entries, settings_general_entries, settings_java_entries,
|
||||
};
|
||||
use update::update_entries;
|
||||
|
||||
@@ -233,6 +233,9 @@ nav_entries! {
|
||||
// M168:中文字体下载状态行(设置页 General 组)。同样只追加在链尾之后——
|
||||
// `catalog/font.rs` 那四条老文案在链中间,往那里追加会平移其后所有 key(金表整片红)。
|
||||
font_install_entries,
|
||||
// M250:强调色一族(设置页 Appearance 组的第一个控件)。同理追加在链尾——`appearance`
|
||||
// 那个域在链中间,往那里追加会平移其后所有 key(金表整片红)。
|
||||
settings_accent_entries,
|
||||
finish,
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -233,4 +233,11 @@ pub(super) const ROWS: &[(&str, &str, &str)] = &[
|
||||
("FontCjkStatusUnknown", "Not determined yet; nothing was downloaded", "尚未判定;没有下载任何字体"),
|
||||
("FontCjkStatusUnprobeable", "System fonts cannot be probed, so nothing was downloaded", "无法探测系统字体,因此没有下载"),
|
||||
("FontCjkStatusHint", "Downloaded once into the data directory and cached; the next start does not download it again. A mirror can be set with ui.font_cdn.", "只下这一次,缓存在数据目录里,下次启动不重下。镜像可用配置键 ui.font_cdn 指定。"),
|
||||
("SettingsAppearanceAccent", "Accent colour", "强调色"),
|
||||
("SettingsAppearanceAccentPresets", "Presets", "预设"),
|
||||
("SettingsAppearanceAccentFactory", "Factory", "出厂"),
|
||||
("SettingsAppearanceAccentHint", "Empty = the factory accent from the brand board. A custom accent replaces primary / secondary / tertiary only; neutral surfaces and error keep the baseline.", "空 = 出厂品牌板的强调色。自定义强调色只替换 primary / secondary / tertiary 三族;中性表面与 error 保持基线。"),
|
||||
("SettingsAppearanceAccentShort", "Accent needs 6 hex digits (RRGGBB); got {digits}.", "强调色要 6 位十六进制(RRGGBB),现在 {digits} 位。"),
|
||||
("SettingsAppearanceAccentLong", "Accent has {digits} digits; a colour takes exactly 6.", "强调色有 {digits} 位,一个颜色只要 6 位。"),
|
||||
("SettingsAppearanceAccentDigit", "Accent contains a character that is not a hex digit: {ch}", "强调色里有非十六进制字符:{ch}"),
|
||||
];
|
||||
@@ -0,0 +1,48 @@
|
||||
//! 设置页「Appearance」分组**强调色**一族的文案(M250 ACCENTWIRE)。
|
||||
//!
|
||||
//! ## 为什么单开一个域文件,而不是写进 `settings/appearance.rs`
|
||||
//!
|
||||
//! `settings_appearance_entries` 在装配链**中间**。往那个域后面追加,会把其后所有 key 在
|
||||
//! `Key::ALL` 里整体平移 ⇒ 金表(逐 index 逐字节)整片红。本域挂在**链尾**
|
||||
//! (`font_install_entries` 之后),于是既有顺序一个不动,金表只需在 `tail2::ROWS` 末尾追加
|
||||
//! (M104 / M106 / M107 / M109 / M114 / M159 / M168 都是这条做法)。
|
||||
//!
|
||||
//! key 前缀仍叫 `SettingsAppearanceAccent*`:`catalog/settings/appearance.rs` 的译文守卫按
|
||||
//! **名字前缀**筛 key,改名会让那两条守卫漏掉这一族。
|
||||
//!
|
||||
//! ## 三档失败原因为什么分开写
|
||||
//!
|
||||
//! `#12`(位数不足)、`#006A5C00`(位数过多)、`zzzzzz`(非十六进制)是三种不同的手误,
|
||||
//! 而「格式不对」对用户没有行动性。分开写之后错行能直接说「现在 2 位」「有非十六进制字符 z」。
|
||||
//!
|
||||
//! 域文件的形状见 [`crate::catalog`] 的「域装配」一节。
|
||||
|
||||
macro_rules! settings_accent_entries {
|
||||
($next:ident, $($rest:ident,)* { $($acc:tt)* }) => {
|
||||
$next! { $($rest,)* {
|
||||
$($acc)*
|
||||
// ── 强调色(M250:设置页 Appearance 组的第一个控件)
|
||||
SettingsAppearanceAccent => ("Accent colour", "强调色"),
|
||||
SettingsAppearanceAccentPresets => ("Presets", "预设"),
|
||||
SettingsAppearanceAccentFactory => ("Factory", "出厂"),
|
||||
SettingsAppearanceAccentHint => (
|
||||
"Empty = the factory accent from the brand board. A custom accent replaces primary / secondary / tertiary only; neutral surfaces and error keep the baseline.",
|
||||
"空 = 出厂品牌板的强调色。自定义强调色只替换 primary / secondary / tertiary 三族;中性表面与 error 保持基线。"
|
||||
),
|
||||
SettingsAppearanceAccentShort => (
|
||||
"Accent needs 6 hex digits (RRGGBB); got {digits}.",
|
||||
"强调色要 6 位十六进制(RRGGBB),现在 {digits} 位。"
|
||||
),
|
||||
SettingsAppearanceAccentLong => (
|
||||
"Accent has {digits} digits; a colour takes exactly 6.",
|
||||
"强调色有 {digits} 位,一个颜色只要 6 位。"
|
||||
),
|
||||
SettingsAppearanceAccentDigit => (
|
||||
"Accent contains a character that is not a hex digit: {ch}",
|
||||
"强调色里有非十六进制字符:{ch}"
|
||||
),
|
||||
} }
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use settings_accent_entries;
|
||||
@@ -7,6 +7,7 @@
|
||||
//! | 文件 | 分组(`pages/settings` 的 `GROUPS`) | 现状 |
|
||||
//! |---|---|---|
|
||||
//! | [`general`] | General(Language / Theme / Startup page / Close button) | 2 条 key(语言) |
|
||||
//! | [`accent`] | Appearance 组的**强调色**一族(M250) | 7 条 key(标签 / 预设 / 三档失败原因 / 说明) |
|
||||
//! | [`appearance`] | Appearance(Density / Corner style / Motion / Text scale) | 预留,暂无 key |
|
||||
//! | [`java`] | Java(Runtime / Default memory / JVM arguments) | 预留,暂无 key |
|
||||
//! | [`download`] | Downloads(Preferred source / Concurrency / Verify checksums) | 预留,暂无 key |
|
||||
@@ -15,12 +16,14 @@
|
||||
//! 「预留」的文件里是**空转移器**(只把累积表原样交给下一个域):加 key 时把条目写进它
|
||||
//! `$($acc)*` 后面即可——签名不用改,`catalog.rs` 不用碰,跨线零冲突。
|
||||
|
||||
mod accent;
|
||||
mod ai;
|
||||
mod appearance;
|
||||
mod download;
|
||||
mod general;
|
||||
mod java;
|
||||
|
||||
pub(crate) use accent::settings_accent_entries;
|
||||
pub(crate) use ai::settings_ai_entries;
|
||||
pub(crate) use appearance::settings_appearance_entries;
|
||||
pub(crate) use download::settings_download_entries;
|
||||
|
||||
Reference in new issue
Block a user