fix(tray): adjust icon size for macOS platform compatibility

This commit is contained in:
Orchard
2026-04-11 10:39:55 +08:00
parent e7d5f51740
commit 33a60fed8c
2 changed files with 6 additions and 5 deletions
+6 -5
View File
@@ -62,10 +62,11 @@ let mainWindow: BrowserWindow | null = null;
let sourceSelectorWindow: BrowserWindow | null = null;
let tray: Tray | null = null;
let selectedSourceName = "";
const isMac = process.platform === "darwin";
// Tray Icons
const defaultTrayIcon = getTrayIcon("openscreen.png");
const recordingTrayIcon = getTrayIcon("rec-button.png");
const defaultTrayIcon = getTrayIcon("openscreen.png", isMac ? 18 : 24);
const recordingTrayIcon = getTrayIcon("rec-button.png", isMac ? 18 : 24);
function createWindow() {
mainWindow = createHudOverlayWindow();
@@ -199,12 +200,12 @@ function createTray() {
});
}
function getTrayIcon(filename: string) {
function getTrayIcon(filename: string, size: number) {
return nativeImage
.createFromPath(path.join(process.env.VITE_PUBLIC || RENDERER_DIST, filename))
.resize({
width: 24,
height: 24,
width: size,
height: size,
quality: "best",
});
}
Binary file not shown.