feat(icon): apply runtime app icon on macOS (#2296)

This commit is contained in:
NIKHIL ACHALE 2026-06-30 15:27:50 +05:30 committed by GitHub
parent de9e90df45
commit 194bb28c8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View File

@ -5,6 +5,7 @@ import {
dialog,
ipcMain,
net,
nativeImage,
Notification as ElectronNotification,
protocol,
shell,
@ -156,6 +157,16 @@ function windowIconPath(): string | undefined {
return existsSync(candidate) ? candidate : undefined;
}
function applyRuntimeAppIcon(): void {
if (process.platform !== "darwin") return;
const iconPath = windowIconPath();
if (!iconPath) return;
const icon = nativeImage.createFromPath(iconPath);
if (!icon.isEmpty()) {
app.dock.setIcon(icon);
}
}
function setDaemonStatus(nextStatus: DaemonStatus): void {
daemonStatus = nextStatus;
mainWindow?.webContents.send("daemon:status", daemonStatus);
@ -952,6 +963,7 @@ app.whenReady().then(async () => {
}
registerRendererProtocol();
applyRuntimeAppIcon();
createWindow();
void startDaemon();
initAutoUpdates();