Skip to content

Commit fd7662c

Browse files
💄 style: fix desktop titlebar style in window (#8439)
* 💄 style: Fix win electron style 📝 docs: Update readme 💄 style: Update useWatchThemeUpdate 💄 style: Update Tray icon 🔧 chore: Update windows 🔧 chore: Update filetree 🔧 chore: Update core 💄 style: Fix desktop draw style 💄 style: Update style 💄 style: Fix backgroundColor 💄 style: Update titlebar style * 💄 style: Fix windows icon * 🔧 chore: Clean * update theme * 💄 style: Update broswer * 💄 style: HandleAppThemeChange * clean * fix memory leak --------- Co-authored-by: arvinxx <arvinx@foxmail.com>
1 parent 66dbb24 commit fd7662c

File tree

30 files changed

+368
-287
lines changed

30 files changed

+368
-287
lines changed

apps/desktop/build/icon-beta.ico

93.3 KB
Binary file not shown.

apps/desktop/build/icon-dev.ico

156 KB
Binary file not shown.

apps/desktop/build/icon-nightly.ico

97.4 KB
Binary file not shown.

apps/desktop/build/icon.ico

99.1 KB
Binary file not shown.

apps/desktop/electron.vite.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ console.log(`[electron-vite.config.ts] Detected UPDATE_CHANNEL: ${updateChannel}
1111
export default defineConfig({
1212
main: {
1313
build: {
14+
minify: !isDev,
1415
outDir: 'dist/main',
15-
sourcemap: isDev,
16+
sourcemap: isDev ? 'inline' : false,
1617
},
1718
// 这里是关键:在构建时进行文本替换
1819
define: {
@@ -30,8 +31,9 @@ export default defineConfig({
3031
},
3132
preload: {
3233
build: {
34+
minify: !isDev,
3335
outDir: 'dist/preload',
34-
sourcemap: isDev,
36+
sourcemap: isDev ? 'inline' : false,
3537
},
3638
plugins: [externalizeDepsPlugin({})],
3739
resolve: {

apps/desktop/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"dependencies": {
3333
"electron-updater": "^6.6.2",
34+
"electron-window-state": "^5.0.3",
3435
"get-port-please": "^3.1.2",
3536
"pdfjs-dist": "4.10.38"
3637
},

apps/desktop/src/main/appBrowsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BrowserWindowOpts } from './core/Browser';
1+
import type { BrowserWindowOpts } from './core/browser/Browser';
22

33
export const BrowsersIdentifiers = {
44
chat: 'chat',

apps/desktop/src/main/const/env.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import { dev, linux, macOS, windows } from 'electron-is';
12
import os from 'node:os';
23

3-
export const isDev = process.env.NODE_ENV === 'development';
4+
export const isDev = dev();
45

56
export const OFFICIAL_CLOUD_SERVER = process.env.OFFICIAL_CLOUD_SERVER || 'https://lobechat.com';
67

7-
export const isMac = process.platform === 'darwin';
8-
export const isWindows = process.platform === 'win32';
9-
export const isLinux = process.platform === 'linux';
8+
export const isMac = macOS();
9+
export const isWindows = windows();
10+
export const isLinux = linux();
1011

1112
function getIsWindows11() {
1213
if (!isWindows) return false;

apps/desktop/src/main/const/store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ export const STORE_DEFAULTS: ElectronMainStore = {
3131
networkProxy: defaultProxySettings,
3232
shortcuts: DEFAULT_SHORTCUTS_CONFIG,
3333
storagePath: appStorageDir,
34+
themeMode: 'auto',
3435
};

apps/desktop/src/main/const/theme.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Theme colors
2+
export const BACKGROUND_DARK = '#000';
3+
export const BACKGROUND_LIGHT = '#f8f8f8';
4+
export const SYMBOL_COLOR_DARK = '#ffffff80';
5+
export const SYMBOL_COLOR_LIGHT = '#00000080';
6+
7+
// Window dimensions and constraints
8+
export const TITLE_BAR_HEIGHT = 29;
9+
10+
// Default window configuration
11+
export const THEME_CHANGE_DELAY = 100;

0 commit comments

Comments
 (0)