🌈 style: 优化代码格式化

This commit is contained in:
alger
2025-01-10 22:49:55 +08:00
parent ddb814da10
commit 62e26cae7d
40 changed files with 450 additions and 239 deletions
+8 -6
View File
@@ -1,4 +1,4 @@
import { app, Menu, nativeImage, Tray, BrowserWindow } from 'electron';
import { app, BrowserWindow, Menu, nativeImage, Tray } from 'electron';
import { join } from 'path';
let tray: Tray | null = null;
@@ -7,7 +7,9 @@ let tray: Tray | null = null;
* 初始化系统托盘
*/
export function initializeTray(iconPath: string, mainWindow: BrowserWindow) {
const trayIcon = nativeImage.createFromPath(join(iconPath, 'icon_16x16.png')).resize({ width: 16, height: 16 });
const trayIcon = nativeImage
.createFromPath(join(iconPath, 'icon_16x16.png'))
.resize({ width: 16, height: 16 });
tray = new Tray(trayIcon);
// 创建一个上下文菜单
@@ -16,15 +18,15 @@ export function initializeTray(iconPath: string, mainWindow: BrowserWindow) {
label: '显示',
click: () => {
mainWindow.show();
},
}
},
{
label: '退出',
click: () => {
mainWindow.destroy();
app.quit();
},
},
}
}
]);
// 设置系统托盘图标的上下文菜单
@@ -40,4 +42,4 @@ export function initializeTray(iconPath: string, mainWindow: BrowserWindow) {
});
return tray;
}
}