diff --git a/docs/shell-theme-previews.md b/docs/shell-theme-previews.md new file mode 100644 index 0000000..b7c80ae --- /dev/null +++ b/docs/shell-theme-previews.md @@ -0,0 +1,28 @@ +# 皮肤选择卡片的预览图是怎么来的 + +面板「云端加密 → 验证界面」里 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/.png` 引用。 + +## 重新生成(换皮肤/改布局后要重跑) + +1. **打 8 个样本**:`packthemed origin64.exe themed/prev_.exe cfg_prev_.json ` + - `cfg_prev_.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 位程序加壳时服务端会自动回落到经典壳。 diff --git a/frontend/public/theme-previews/card.png b/frontend/public/theme-previews/card.png new file mode 100644 index 0000000..d05633f Binary files /dev/null and b/frontend/public/theme-previews/card.png differ diff --git a/frontend/public/theme-previews/classic.png b/frontend/public/theme-previews/classic.png new file mode 100644 index 0000000..af116e2 Binary files /dev/null and b/frontend/public/theme-previews/classic.png differ diff --git a/frontend/public/theme-previews/compact.png b/frontend/public/theme-previews/compact.png new file mode 100644 index 0000000..261d50b Binary files /dev/null and b/frontend/public/theme-previews/compact.png differ diff --git a/frontend/public/theme-previews/dark.png b/frontend/public/theme-previews/dark.png new file mode 100644 index 0000000..3e4507e Binary files /dev/null and b/frontend/public/theme-previews/dark.png differ diff --git a/frontend/public/theme-previews/industrial.png b/frontend/public/theme-previews/industrial.png new file mode 100644 index 0000000..e91aa17 Binary files /dev/null and b/frontend/public/theme-previews/industrial.png differ diff --git a/frontend/public/theme-previews/light.png b/frontend/public/theme-previews/light.png new file mode 100644 index 0000000..19a5994 Binary files /dev/null and b/frontend/public/theme-previews/light.png differ diff --git a/frontend/public/theme-previews/split.png b/frontend/public/theme-previews/split.png new file mode 100644 index 0000000..f321c29 Binary files /dev/null and b/frontend/public/theme-previews/split.png differ diff --git a/frontend/public/theme-previews/terminal.png b/frontend/public/theme-previews/terminal.png new file mode 100644 index 0000000..7e397b9 Binary files /dev/null and b/frontend/public/theme-previews/terminal.png differ diff --git a/frontend/src/pages/admin/protect/index.vue b/frontend/src/pages/admin/protect/index.vue index 321e295..1fb2761 100644 --- a/frontend/src/pages/admin/protect/index.vue +++ b/frontend/src/pages/admin/protect/index.vue @@ -87,6 +87,18 @@ const themeOptions = computed(() => [ { value: 'terminal', label: t('admin.protect.themeTerminal') }, ]) // DuiLib 壳目前只有 64 位构建;32 位程序产物会回落到 classic 壳(服务端处理) +// 皮肤名形如「深色 · 卡密登录」:卡片上标题取前半,副标题取后半 +function themeTitle(label: string) { + return label.split('·')[0].trim() +} +function themeSub(label: string) { + const parts = label.split('·') + return parts.length > 1 ? parts.slice(1).join('·').trim() : '' +} +// 位宽提示:经典壳 32/64 位都有产物,DuiLib 那几套只有 64 位构建 +function themeBits(theme: string) { + return theme === 'classic' ? t('admin.protect.themeBits32') : t('admin.protect.themeBits64') +} const themeDisabled = computed(() => false) // 证书选择:直接列「每一套证书」(不再先选文件、再选身份) @@ -535,25 +547,46 @@ onBeforeUnmount(() => { {{ certOptionsForFile.length ? t('admin.protect.signProfileHint') : t('admin.protect.signProfileEmpty') }}

- -
- - {{ t('admin.protect.themeLabel') }} - - - - - - - - {{ o.label }} - - - + +
+
+ + {{ t('admin.protect.themeLabel') }} + + {{ t('admin.protect.themeGridHint') }} +
+
+ +
+

+ {{ t('admin.protect.themeHint') }} +

-

- {{ t('admin.protect.themeHint') }} -

diff --git a/frontend/src/plugins/i18n/en.json b/frontend/src/plugins/i18n/en.json index 762b14b..897c691 100644 --- a/frontend/src/plugins/i18n/en.json +++ b/frontend/src/plugins/i18n/en.json @@ -2662,14 +2662,17 @@ "themeDark": "Dark · card key login", "themeLight": "Light · office style", "themeIndustrial": "Industrial blue · device licensing", - "themeHint": "DuiLib skins apply to 64-bit builds; 32-bit binaries keep the classic shell.", + "themeHint": "DuiLib skins are 64-bit builds only; 32-bit programs fall back to the classic shell automatically.", "themeCompact": "Compact banner · single row", "themeSplit": "Split · brand sidebar", "themeCard": "Wide card · two columns", "themeTerminal": "Terminal style", "programVersionLabel": "Program version", "programVersionPlaceholder": "e.g. 1.2.3 (leave empty to skip update check)", - "programVersionHint": "When set, the packaged program asks the platform for updates on startup. Publishing a newer version shows an update prompt; forced updates cannot be skipped." + "programVersionHint": "When set, the packaged program asks the platform for updates on startup. Publishing a newer version shows an update prompt; forced updates cannot be skipped.", + "themeGridHint": "Click a skin to apply it to the build — screenshots are from the real client", + "themeBits64": "64-bit", + "themeBits32": "32/64-bit" }, "signProfiles": { "title": "Signing certificates", diff --git a/frontend/src/plugins/i18n/zh.json b/frontend/src/plugins/i18n/zh.json index c429bce..b1bffab 100644 --- a/frontend/src/plugins/i18n/zh.json +++ b/frontend/src/plugins/i18n/zh.json @@ -2681,14 +2681,17 @@ "themeDark": "深色 · 卡密登录", "themeLight": "浅色 · 办公风", "themeIndustrial": "工业蓝 · 设备授权", - "themeHint": "DuiLib 皮肤目前 64 位生效;32 位程序仍用经典壳。选好皮肤后云端加密,产物弹窗就按该皮肤渲染。", + "themeHint": "DuiLib 皮肤只做了 64 位构建,32 位程序固定用经典壳(服务端会自动回落)。选好后云端加密,产物验证弹窗就按这套皮肤渲染。", "themeCompact": "极简横幅 · 单行激活", "themeSplit": "左右分栏 · 品牌竖栏", "themeCard": "宽扁卡片 · 双列说明", "themeTerminal": "终端风 · 命令行", "programVersionLabel": "程序版本", "programVersionPlaceholder": "例如 1.2.3(留空则不检查更新)", - "programVersionHint": "填了版本号后,程序启动时会向平台查询是否有更新;平台里发布更高版本就会弹出更新提示,设为强制更新时不允许跳过。" + "programVersionHint": "填了版本号后,程序启动时会向平台查询是否有更新;平台里发布更高版本就会弹出更新提示,设为强制更新时不允许跳过。", + "themeGridHint": "点一套直接套用到产物,下面是各套界面实拍", + "themeBits64": "64 位", + "themeBits32": "32/64 位" }, "signProfiles": { "title": "签名证书",