Fix: 修复不能移动界面的 bug,兼容移动和鼠标点击,并将窗口大小修改为 200px
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user