fix(app-iced): 选项区变高时与版本列表对半分(S1)+ 中英出图注入 + 注释同步
D30 r1 视觉驳回的三条里,代码能修的两条: 1. **S1 版面**:带加载器版本列表的选项区在三栏档把版本列表从 6.0 行压到 2.4 行(1180×760 实测 278px→110px,底缘切在第三行图标上)。`rows::TailShare::of` 现在让这类面板在**任何档位** 都与列表对半分(`scrollable` 分支早已存在),另把加载器版本菜单改成**按条目数**占高 (1 条 64px / 2 条 112px,原先只有 1 条也固定撑两行)。实测:列表回到 **245px = 5.3 行**。 2. **注释同步(S6)**:`options/view.rs` 模块头原先写「加载器分成两行」+ 两行示意,实际是 六枚一行(末枚右缘约 404px / 正文列 424);那条「本轮无看图通道,未出截图」也换成实测值。 顺带(使能中文出图):`pages/mod.rs::demo_model` 读 `ULL_DL_LANG=zh` 把 `model.lang` 与下载页 目录一起切中文。之前 `LC_ALL=zh_CN.UTF-8` 对出图**完全无效**——页面文案来自 `model.lang`, 而 `Model::new` 写死 `En`、`demo_model` 不碰它(`i18n::detect_env` 不在这条链上)。 测试:`options/s1_tests.rs` 新增两条(菜单只按整行占高;带版本列表的选项区在每个档位都 Shared, 原版/不兼容仍 Pinned),`-p unlucky-app-iced` 862 passed。 未完成:S2 窄窗「滚到底」图——iced 0.14 没有自由函数 `scroll_to`,程序化滚动要手写 `widget::Operation`(约 40 行),本轮不拿半成品充数;面板 `scrollable` 的稳定 Id 已就位。
This commit is contained in:
1 parent
841c17152a
commit
cd7813f8eb
7 files changed
+162
-18
No files matched your search
@@ -323,9 +323,20 @@ pub fn app_with_appearance<'a>(
|
||||
/// 真的传进来,否则「矮窗口那几张图」画的是高窗口的版面。
|
||||
pub fn demo_model(screen: Screen, window_width: f32, window_height: f32) -> Model {
|
||||
let mut model = Model::new(screen, window_width, window_height, Some(screen.nav()));
|
||||
// 出图的中英取证(M222):`ULL_DL_LANG=zh` 时整页走中文目录。
|
||||
//
|
||||
// 为什么需要这一行:页面文案来自 `model.lang`(`download::view(.., lang)` → `lang.catalog()`),
|
||||
// 而 `Model::new` 的 `lang` 写死 `En`、`demo_model` 之前也不碰它——所以 `LC_ALL=zh_CN.UTF-8`
|
||||
// 对出图**完全无效**(`i18n::detect_env` 不在这条链上,Windows 上平台源还会压过 env)。
|
||||
// 只有 harness / 单测走 `demo_model`,产品路径由 `app/view.rs` 从 `AppState` 建模型,零影响。
|
||||
let lang = match std::env::var("ULL_DL_LANG").ok().as_deref().map(str::trim) {
|
||||
Some("zh" | "zh_cn" | "zh-CN" | "zh_CN") => unlucky_i18n::Lang::ZhCn,
|
||||
_ => unlucky_i18n::Lang::En,
|
||||
};
|
||||
model.lang = lang;
|
||||
match screen {
|
||||
Screen::Instances => model.instances = instances::demo(),
|
||||
Screen::Download => model.download = download::demo(unlucky_i18n::Lang::En.catalog()),
|
||||
Screen::Download => model.download = download::demo(lang.catalog()),
|
||||
Screen::Content => model.content = content::demo(content::ContentKind::Mod, model.lang),
|
||||
Screen::Logs => model.logs = logs::demo(model.lang),
|
||||
// M159:设置页「更新」组的出图夹具(一个可装的新版本 + 一次成功检查)。
|
||||
|
||||
Reference in new issue
Block a user