diff --git a/src/main/index.ts b/src/main/index.ts index eacfe99..7385336 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,19 +1,25 @@ // src/main/index.ts -import { app, BrowserWindow, nativeTheme } from 'electron' +import { app, BrowserWindow, nativeTheme, nativeImage } from 'electron' import { join } from 'path' import { restoreAndTrack } from './win-state' import { registerIpcHandlers } from './ipc-handlers' let mainWindow: BrowserWindow | null = null +function getIconPath(): string { + return join(__dirname, '../../build/icons/icon_256.png') +} + function createWindow(): void { + const iconPath = getIconPath() + mainWindow = new BrowserWindow({ width: 1200, height: 800, minWidth: 900, minHeight: 600, title: 'JRedisDesktop', - icon: join(__dirname, '../../build/icons/icon_256.png'), + icon: nativeImage.createFromPath(iconPath), backgroundColor: nativeTheme.shouldUseDarkColors ? '#0f0f1a' : '#f8fafc', webPreferences: { preload: join(__dirname, '../preload/index.mjs'), @@ -25,6 +31,11 @@ function createWindow(): void { titleBarStyle: 'hidden', }) + // Linux taskbar icon + if (process.platform === 'linux') { + app.setIcon(iconPath) + } + restoreAndTrack(mainWindow) if (process.env.ELECTRON_RENDERER_URL) { diff --git a/src/renderer/src/components/MainArea.vue b/src/renderer/src/components/MainArea.vue index 8e08b4e..0305124 100644 --- a/src/renderer/src/components/MainArea.vue +++ b/src/renderer/src/components/MainArea.vue @@ -77,7 +77,7 @@ watch(
Select or create a connection to get started