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 // src/main/index.ts
import { app, BrowserWindow, nativeTheme } from 'electron' import { app, BrowserWindow, nativeTheme, nativeImage } from 'electron'
import { join } from 'path' import { join } from 'path'
import { restoreAndTrack } from './win-state' import { restoreAndTrack } from './win-state'
import { registerIpcHandlers } from './ipc-handlers' import { registerIpcHandlers } from './ipc-handlers'
let mainWindow: BrowserWindow | null = null let mainWindow: BrowserWindow | null = null
function getIconPath(): string {
return join(__dirname, '../../build/icons/icon_256.png')
}
function createWindow(): void { function createWindow(): void {
const iconPath = getIconPath()
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1200, width: 1200,
height: 800, height: 800,
minWidth: 900, minWidth: 900,
minHeight: 600, minHeight: 600,
title: 'JRedisDesktop', title: 'JRedisDesktop',
icon: join(__dirname, '../../build/icons/icon_256.png'), icon: nativeImage.createFromPath(iconPath),
backgroundColor: nativeTheme.shouldUseDarkColors ? '#0f0f1a' : '#f8fafc', backgroundColor: nativeTheme.shouldUseDarkColors ? '#0f0f1a' : '#f8fafc',
webPreferences: { webPreferences: {
preload: join(__dirname, '../preload/index.mjs'), preload: join(__dirname, '../preload/index.mjs'),
@@ -25,6 +31,11 @@ function createWindow(): void {
titleBarStyle: 'hidden', titleBarStyle: 'hidden',
}) })
// Linux taskbar icon
if (process.platform === 'linux') {
app.setIcon(iconPath)
}
restoreAndTrack(mainWindow) restoreAndTrack(mainWindow)
if (process.env.ELECTRON_RENDERER_URL) { if (process.env.ELECTRON_RENDERER_URL) {
+4 -3
View File
@@ -77,7 +77,7 @@ watch(
</div> </div>
<div v-else class="no-connection"> <div v-else class="no-connection">
<div class="placeholder-icon">R</div> <div class="placeholder-icon">JRD</div>
<h2>JRedisDesktop</h2> <h2>JRedisDesktop</h2>
<p>Select or create a connection to get started</p> <p>Select or create a connection to get started</p>
</div> </div>
@@ -137,18 +137,19 @@ watch(
} }
.placeholder-icon { .placeholder-icon {
width: 64px; width: 80px;
height: 64px; height: 64px;
background: linear-gradient(135deg, #667eea, #764ba2); background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 16px; border-radius: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 28px; font-size: 22px;
font-weight: 800; font-weight: 800;
color: #fff; color: #fff;
margin-bottom: 20px; margin-bottom: 20px;
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2); box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
letter-spacing: 1px;
} }
.no-connection h2 { .no-connection h2 {
+5 -4
View File
@@ -15,7 +15,7 @@ function toggleTheme() {
<template> <template>
<header class="titlebar"> <header class="titlebar">
<div class="titlebar-drag"> <div class="titlebar-drag">
<span class="titlebar-logo">R</span> <span class="titlebar-logo">JRD</span>
<span class="titlebar-title">JRedisDesktop</span> <span class="titlebar-title">JRedisDesktop</span>
</div> </div>
<div class="titlebar-actions"> <div class="titlebar-actions">
@@ -50,16 +50,17 @@ function toggleTheme() {
} }
.titlebar-logo { .titlebar-logo {
width: 24px; width: 36px;
height: 24px; height: 24px;
background: linear-gradient(135deg, #667eea, #764ba2); background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 6px; border-radius: 6px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 12px; font-size: 9px;
font-weight: 700; font-weight: 800;
color: #fff; color: #fff;
letter-spacing: 0.5px;
} }
.titlebar-title { .titlebar-title {