mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
fix: 修复 Windows 下 tray 图标路径错误,与其他窗口 icon 路径逻辑保持一致
This commit is contained in:
@@ -2446,12 +2446,12 @@ app.whenReady().then(async () => {
|
|||||||
updateSplashProgress(30, '正在加载界面...')
|
updateSplashProgress(30, '正在加载界面...')
|
||||||
mainWindow = createWindow({ autoShow: false })
|
mainWindow = createWindow({ autoShow: false })
|
||||||
|
|
||||||
// 初始化系统托盘图标
|
// 初始化系统托盘图标(与其他窗口 icon 路径逻辑保持一致)
|
||||||
const trayIconPath = process.platform === 'win32'
|
const resolvedTrayIcon = process.platform === 'win32'
|
||||||
? join(process.resourcesPath, 'icon.ico')
|
? join(__dirname, '../public/icon.ico')
|
||||||
: join(process.resourcesPath, 'resources', 'icon.icns')
|
: (process.platform === 'darwin'
|
||||||
const trayIconFallback = join(__dirname, '..', 'resources', process.platform === 'win32' ? 'icon.ico' : 'icon.icns')
|
? join(process.resourcesPath, 'icon.icns')
|
||||||
const resolvedTrayIcon = existsSync(trayIconPath) ? trayIconPath : trayIconFallback
|
: join(process.resourcesPath, 'icon.ico'))
|
||||||
try {
|
try {
|
||||||
tray = new Tray(resolvedTrayIcon)
|
tray = new Tray(resolvedTrayIcon)
|
||||||
tray.setToolTip('WeFlow')
|
tray.setToolTip('WeFlow')
|
||||||
|
|||||||
Reference in New Issue
Block a user