Skip to content

Commit e46df8a

Browse files
committed
feat: 优化窗口大小管理功能,优化窗口状态保存与恢复逻辑
- 引入窗口大小管理器,初始化窗口大小管理 - 优化窗口状态保存与恢复,确保在迷你模式下正确应用窗口大小 - 移除不必要的代码,简化窗口管理逻辑 - 更新窗口创建逻辑,确保窗口大小和位置的正确性
1 parent b203077 commit e46df8a

File tree

5 files changed

+825
-257
lines changed

5 files changed

+825
-257
lines changed

src/main/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { initializeTray, updateCurrentSong, updatePlayState, updateTrayMenu } fr
1515
import { setupUpdateHandlers } from './modules/update';
1616
import { createMainWindow, initializeWindowManager } from './modules/window';
1717
import { startMusicApi } from './server';
18+
import { initWindowSizeManager } from './modules/window-size';
1819

1920
// 导入所有图标
2021
const iconPath = join(__dirname, '../../resources');
@@ -99,6 +100,9 @@ if (!isSingleInstance) {
99100
optimizer.watchWindowShortcuts(window);
100101
});
101102

103+
// 初始化窗口大小管理器
104+
initWindowSizeManager();
105+
102106
// 初始化应用
103107
initialize();
104108

src/main/modules/fileManager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import * as NodeID3 from 'node-id3';
88
import * as path from 'path';
99
import * as os from 'os';
1010
import * as mm from 'music-metadata';
11-
// 导入文件类型库,这里使用CommonJS兼容方式导入
12-
// 对于file-type v21.0.0需要这样导入
1311
import { fileTypeFromFile } from 'file-type';
1412

1513
import { getStore } from './config';

0 commit comments

Comments
 (0)