feat(main): 增加F12切换开发者工具快捷键并调整窗口宽度
- 将主窗口宽度从900px调整为1200px以提供更好的布局空间 - 注册全局快捷键F12,用于快速打开/关闭右侧开发者工具面板 - 优化开发体验,便于调试和检查应用状态
This commit is contained in:
1 parent
0ef0ecac79
commit
dcb7f2a39f
1 file changed
+12
-1
+12
-1
@@ -6,11 +6,12 @@ import { registerHandlers } from './ipc/handlers'
|
||||
import { IngestionService } from './services/ingestion/FileLoader'
|
||||
import { EmbeddingService } from './services/vector/EmbeddingService'
|
||||
import { UnifiedStore } from './services/storage/UnifiedStore'
|
||||
import { globalShortcut } from 'electron'
|
||||
|
||||
function createWindow(): void {
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 900,
|
||||
width: 1200,
|
||||
height: 670,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
@@ -37,6 +38,16 @@ function createWindow(): void {
|
||||
} else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
}
|
||||
|
||||
globalShortcut.register('F12', () => {
|
||||
const wc = mainWindow.webContents
|
||||
|
||||
if (wc.isDevToolsOpened()) {
|
||||
wc.closeDevTools()
|
||||
} else {
|
||||
wc.openDevTools({ mode: 'right' })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
|
||||
Reference in new issue
Block a user