Skip to content

Commit

Permalink
Merge pull request #82 from holochain/feat/fix-window-icon
Browse files Browse the repository at this point in the history
Add window icons
  • Loading branch information
matthme authored May 10, 2024
2 parents 8b9f2c8 + 1af40b9 commit 568caae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,19 @@ const createAdminWindow = ({
title,
optWidth,
frame = false,
icon,
}: {
title: string;
optWidth?: number;
frame?: boolean;
icon?: Electron.NativeImage;
}) =>
new BrowserWindow({
frame: frame,
width: optWidth || WINDOW_SIZE,
minWidth: optWidth || WINDOW_SIZE,
height: WINDOW_SIZE,
icon,
minHeight: MIN_HEIGH,
title: title,
show: false,
Expand All @@ -91,16 +94,18 @@ export const focusVisibleWindow = (launcherWindows: Record<Screen, BrowserWindow
export const setupAppWindows = () => {
let isQuitting = false;
// Create the browser window.
const mainWindow = createAdminWindow({ title: 'Holochain Launcher' });
const mainIcon = nativeImage.createFromPath(path.join(ICONS_DIRECTORY, '../icon.png'));
const mainWindow = createAdminWindow({ title: 'Holochain Launcher', icon: mainIcon });

const settingsWindow = createAdminWindow({
title: 'Holochain Launcher Settings',
title: 'Settings - Holochain Launcher',
frame: true,
optWidth: SETTINGS_SIZE,
icon: mainIcon,
});

const icon = nativeImage.createFromPath(path.join(ICONS_DIRECTORY, '16x16.png'));
const tray = new Tray(icon);
const trayIcon = nativeImage.createFromPath(path.join(ICONS_DIRECTORY, '16x16.png'));
const tray = new Tray(trayIcon);

loadOrServe(mainWindow, { screen: MAIN_SCREEN });

Expand Down

0 comments on commit 568caae

Please sign in to comment.