feat: squircle dock icon for macOS dev mode

macOS only applies the squircle mask to packaged .app bundles. For dev
mode, generate a pre-masked icon-dock.png via Swift/AppKit at launch
and set it with app.dock.setIcon(). Silently skipped on non-macOS.
This commit is contained in:
Jannis Braun
2026-03-16 04:15:09 +01:00
parent da05eb3262
commit c176ea801a
3 changed files with 32 additions and 1 deletions
+10
View File
@@ -513,6 +513,16 @@ if (!gotTheLock) {
// ─── App Lifecycle ──────────────────────────────────────────────────────────
app.whenReady().then(async () => {
// Set dock icon on macOS (overrides default Electron icon in dev mode)
if (process.platform === 'darwin' && app.dock) {
const dockIcon = path.join(__dirname, '..', 'build', 'icon-dock.png');
const fallbackIcon = path.join(__dirname, '..', 'build', 'icon.png');
const iconPath = fs.existsSync(dockIcon) ? dockIcon : fallbackIcon;
if (fs.existsSync(iconPath)) {
app.dock.setIcon(iconPath);
}
}
// macOS application menu with "Change Instance"
if (process.platform === 'darwin') {
const appMenu = Menu.buildFromTemplate([