Fix: 修复不能移动界面的 bug,兼容移动和鼠标点击,并将窗口大小修改为 200px

This commit is contained in:
2025-08-26 18:58:07 +08:00
parent 3e770368b5
commit a1183a35d3
3 changed files with 84 additions and 55 deletions

View File

@ -73,8 +73,8 @@ let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 300,
height: 300,
width: 200,
height: 200,
transparent: true, // 开启透明窗口
frame: false, // 无边框窗口
resizable: false, // 禁止调整大小
@ -85,6 +85,11 @@ function createWindow() {
},
});
// 当渲染进程传来这个事件时,就移动窗口
ipcMain.on('move-window', (event, { x, y }) => {
mainWindow.setPosition(x, y, true); // true 表示动画平滑移动
});
if (process.env.NODE_ENV === "development") {
mainWindow.loadURL("http://localhost:5173");
} else {