mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-27 15:08:39 +02:00
feat: add Electron app icon
Move the root logo into app assets, wire the Electron main window to use the branded icon, and stamp the packaged Windows executable icon with rcedit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { posix, win32 } from 'node:path';
|
||||
|
||||
export interface WindowIconPathContext {
|
||||
readonly appPath: string;
|
||||
readonly platform: NodeJS.Platform;
|
||||
}
|
||||
|
||||
function getPathModule(platform: NodeJS.Platform) {
|
||||
return platform === 'win32' ? win32 : posix;
|
||||
}
|
||||
|
||||
export function resolveWindowIconPath(context: WindowIconPathContext): string {
|
||||
const pathModule = getPathModule(context.platform);
|
||||
const iconFileName = context.platform === 'win32' ? 'app-icon.ico' : 'app-icon.png';
|
||||
|
||||
return pathModule.join(context.appPath, 'assets', 'icons', iconFileName);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import { BrowserWindow, Menu, shell } from 'electron';
|
||||
import { app, BrowserWindow, Menu, shell } from 'electron';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import { resolveWindowIconPath } from '@main/windows/appIcon';
|
||||
|
||||
export function createMainWindow(): BrowserWindow {
|
||||
Menu.setApplicationMenu(null);
|
||||
|
||||
@@ -10,6 +12,10 @@ export function createMainWindow(): BrowserWindow {
|
||||
minWidth: 1120,
|
||||
minHeight: 720,
|
||||
title: 'kopaya',
|
||||
icon: resolveWindowIconPath({
|
||||
appPath: app.getAppPath(),
|
||||
platform: process.platform,
|
||||
}),
|
||||
backgroundColor: '#09090b',
|
||||
titleBarStyle: 'hidden',
|
||||
titleBarOverlay: {
|
||||
|
||||
Reference in New Issue
Block a user