fix(tray): adjust icon size for macOS platform compatibility
This commit is contained in:
+6
-5
@@ -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.
Reference in New Issue
Block a user