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 sourceSelectorWindow: BrowserWindow | null = null;
let tray: Tray | null = null; let tray: Tray | null = null;
let selectedSourceName = ""; let selectedSourceName = "";
const isMac = process.platform === "darwin";
// Tray Icons // Tray Icons
const defaultTrayIcon = getTrayIcon("openscreen.png"); const defaultTrayIcon = getTrayIcon("openscreen.png", isMac ? 18 : 24);
const recordingTrayIcon = getTrayIcon("rec-button.png"); const recordingTrayIcon = getTrayIcon("rec-button.png", isMac ? 18 : 24);
function createWindow() { function createWindow() {
mainWindow = createHudOverlayWindow(); mainWindow = createHudOverlayWindow();
@@ -199,12 +200,12 @@ function createTray() {
}); });
} }
function getTrayIcon(filename: string) { function getTrayIcon(filename: string, size: number) {
return nativeImage return nativeImage
.createFromPath(path.join(process.env.VITE_PUBLIC || RENDERER_DIST, filename)) .createFromPath(path.join(process.env.VITE_PUBLIC || RENDERER_DIST, filename))
.resize({ .resize({
width: 24, width: size,
height: 24, height: size,
quality: "best", quality: "best",
}); });
} }
Binary file not shown.