fix: 更新所有图标为 JRD

- 任务栏图标使用 nativeImage
- Linux 使用 app.setIcon()
- TitleBar logo 改为 JRD
- MainArea placeholder 改为 JRD
This commit is contained in:
2026-07-04 20:34:34 +08:00
parent f078f037dc
commit 687fea4018
3 changed files with 22 additions and 9 deletions
+13 -2
View File
@@ -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) {
+4 -3
View File
@@ -77,7 +77,7 @@ watch(
</div>
<div v-else class="no-connection">
<div class="placeholder-icon">R</div>
<div class="placeholder-icon">JRD</div>
<h2>JRedisDesktop</h2>
<p>Select or create a connection to get started</p>
</div>
@@ -137,18 +137,19 @@ watch(
}
.placeholder-icon {
width: 64px;
width: 80px;
height: 64px;
background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
font-size: 22px;
font-weight: 800;
color: #fff;
margin-bottom: 20px;
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
letter-spacing: 1px;
}
.no-connection h2 {
+5 -4
View File
@@ -15,7 +15,7 @@ function toggleTheme() {
<template>
<header class="titlebar">
<div class="titlebar-drag">
<span class="titlebar-logo">R</span>
<span class="titlebar-logo">JRD</span>
<span class="titlebar-title">JRedisDesktop</span>
</div>
<div class="titlebar-actions">
@@ -50,16 +50,17 @@ function toggleTheme() {
}
.titlebar-logo {
width: 24px;
width: 36px;
height: 24px;
background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
font-size: 9px;
font-weight: 800;
color: #fff;
letter-spacing: 0.5px;
}
.titlebar-title {