cysamurai 2 months ago
parent cc6713e0d8
commit 1d5ac78fed

@ -74,3 +74,39 @@ Tauri 原始输出目录:
- `call-client/src-tauri/tauri.conf.json` - `call-client/src-tauri/tauri.conf.json`
- `broadcast-client/src-tauri/tauri.conf.json` - `broadcast-client/src-tauri/tauri.conf.json`
## 4. 应用图标bundle
### 推荐:`tauri icon``@tauri-apps/cli` 内置,社区常用)
Tauri 官方 CLI 提供 **`tauri icon`**:用**一张**高质量源图生成各平台所需尺寸(`32x32.png`、`128x128.png`、`icon.ico` 等)。部分环境下 **`tauri.conf.json``bundle.icon` 不会自动改写**,若发现未更新,请确认其中包含上述生成文件(本仓库已按生成结果维护默认列表)。
**源图要求:** 正方形 **PNG**,建议 **1024×1024****RGBA**(带透明)。可先用 Photoshop / Figma 导出一张再执行下面命令。
在各子项目根目录执行:
```bash
# call-client默认源图src-tauri/icons/call_icon.png
cd call-client
npm run icons:generate
```
```bash
# broadcast-client默认源图src-tauri/icons/bc_icon.png
cd broadcast-client
npm run icons:generate
```
等价命令:
```bash
npm run tauri -- icon ./src-tauri/icons/call_icon.png
# 或 broadcast-client 下对 bc_icon.png
```
生成结果会写入各项目 `src-tauri/icons/`。若 **`bundle.icon` 未自动更新**,请对照目录里新生成的 `32x32.png`、`128x128.png`、`128x128@2x.png`、`icon.icns`、`icon.ico`、`icon.png` 检查配置。换源图路径可改对应 `package.json` 里的 **`icons:generate`** 脚本。
### 说明
- 这里使用的是 **`@tauri-apps/cli` 自带的 `icon` 子命令**,无需再装名为 `tauri-icon` 的独立包若文档里写作「tauri-icon 工具」,一般即指该命令。
- 源图若不是 RGBA构建阶段仍可能报 `icon ... is not RGBA`,请在上游导出时勾选透明度。

@ -18,7 +18,8 @@
"test": "vitest", "test": "vitest",
"test:run": "vitest run", "test:run": "vitest run",
"preview": "vite preview", "preview": "vite preview",
"tauri": "tauri" "tauri": "tauri",
"icons:generate": "tauri icon ./src-tauri/icons/bc_icon.png"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1", "@tauri-apps/api": "^1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 1015 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 321 KiB

@ -47,7 +47,12 @@
"bundleMediaFramework": false "bundleMediaFramework": false
}, },
"icon": [ "icon": [
"icons/bc_icon.png" "icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico",
"icons/icon.png"
] ]
} }
} }

@ -18,7 +18,8 @@
"test": "vitest", "test": "vitest",
"test:run": "vitest run", "test:run": "vitest run",
"preview": "vite preview", "preview": "vite preview",
"tauri": "tauri" "tauri": "tauri",
"icons:generate": "tauri icon ./src-tauri/icons/call_icon.png"
}, },
"dependencies": { "dependencies": {
"@element-plus/icons-vue": "^2.3.2", "@element-plus/icons-vue": "^2.3.2",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 171 KiB

@ -53,7 +53,12 @@
"bundleMediaFramework": false "bundleMediaFramework": false
}, },
"icon": [ "icon": [
"icons/call_icon.png" "icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico",
"icons/icon.png"
] ]
} }
} }

Loading…
Cancel
Save