Files
verify/docs/shell-theme-previews.md
admin 74355c1dd2 feat(ui): 验证界面皮肤改成带实拍预览的卡片,位宽限制做成徽标
- 皮肤选择从下拉框换成 8 张 560x420 实拍预览卡片(选中高亮 + 勾选)
- 卡片右上角徽标区分「32/64 位」与「64 位」,说明 DuiLib 皮肤只做 64 位构建
- 原来那句 themeHint 缩短并降级为脚注,不再占一整行正文
- 预览图来自真实产物截图(docs/shell-theme-previews.md 记了重跑步骤)
2026-11-24 10:29:58 +08:00

29 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 皮肤选择卡片的预览图是怎么来的
面板「云端加密 → 验证界面」里 8 张预览图是**真机截图**,不是设计稿:
```
frontend/public/theme-previews/{classic,dark,light,industrial,compact,split,card,terminal}.png
```
统一 560×420(4:3),窗口居中、去掉黑边,单张 14–33KB,合计约 190KB。构建时由 Vite 原样拷进 `dist/theme-previews/`,页面里按 `/theme-previews/<theme>.png` 引用。
## 重新生成(换皮肤/改布局后要重跑)
1. **打 8 个样本**:`packthemed origin64.exe themed/prev_<theme>.exe cfg_prev_<theme>.json <theme>`
- `cfg_prev_<theme>.json` 里的 `name` 用中性值(例如「示例软件」),不要留测试名
- **`cfg` 里的 `theme` 必须和该主题一致**:`PatchSignedThemed` 只按第四个参数挑要嵌的 shell DLL,不会改写 cfg;cfg 里写错皮肤名,8 个产物会渲染成同一套
2. **截图**:`/root/work/shot64.sh prev_classic prev_dark …`
- `Xvfb :99` + `openbox` + `scrot`
- **必须用独立的 64 位 prefix**(`WINEPREFIX=/root/.wine64 WINEARCH=win64`):装了 `wine32:i386` 之后默认 prefix 会报 `could not load kernel32.dll`
- 每轮开始前 `wineserver -k` 并等到可见窗口数归零,否则会截到上一套皮肤的窗口
3. **裁边 + 统一尺寸**:`python3 /root/work/mktheme_previews.py`
- 不依赖 PIL:用 `ffmpeg -f rawvideo -pix_fmt rgb24` 取出像素
- 窗口边界用**逐列/逐行亮像素密度**判定(阈值 + 最小像素数),避免桌面上的零星亮像素把边界撑大导致缩略图偏心
- `scale=W:H:force_original_aspect_ratio=decrease` 后再 `pad`,保证任何宽高比的窗口都不变形
4. **重新构建前端**:`npm run build`,否则页面拿到的还是旧的 `dist/theme-previews/`
## 位宽徽标
卡片右上角的徽标由 `themeBits()` 决定:`classic` 显示「32/64 位」,其余 7 套显示「64 位」—— 因为 DuiLib 皮肤只做了 64 位构建,32 位程序加壳时服务端会自动回落到经典壳。