fix: 更新所有图标为 JRD
- 任务栏图标使用 nativeImage - Linux 使用 app.setIcon() - TitleBar logo 改为 JRD - MainArea placeholder 改为 JRD
This commit is contained in:
+13
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user