feat: 微调界面;设置最小宽度+高度;修复播放器非全屏不显示的问题

This commit is contained in:
lqtmcstudio
2026-01-03 17:32:45 +08:00
parent 01cb72a88b
commit ebfe430746
4 changed files with 88 additions and 99 deletions

View File

@@ -30,13 +30,22 @@ function createWindow() {
win = new BrowserWindow({
// 🔧 禁用原生标题栏(无边框)
frame: false,
// 设置窗口最小大小
minWidth: 950,
minHeight: 700,
// 设置初始窗口大小
width: 1000,
height: 800,
icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
webPreferences: {
preload: path.join(__dirname, 'preload.mjs'),
},
})
if (process.env.NODE_ENV === 'development') {
win.webContents.openDevTools({ mode: 'right' }); // 可选:'undocked', 'bottom', 'right'
}
// Test active push message to Renderer-process.
win.webContents.on('did-finish-load', () => {
win?.webContents.send('main-process-message', new Date().toLocaleString())