🎨 The PDF/Word export preview window automatically adjusts according to the size of the main window https://github.com/siyuan-note/siyuan/issues/10554

This commit is contained in:
Daniel 2024-03-09 18:05:36 +08:00
parent b9e2b7661e
commit 3ced66f749
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -859,12 +859,16 @@ app.whenReady().then(() => {
});
});
ipcMain.on("siyuan-export-newwindow", (event, data) => {
const parentWnd = getWindowByContentId(event.sender.id);
// The PDF/Word export preview window automatically adjusts according to the size of the main window https://github.com/siyuan-note/siyuan/issues/10554
const width = parentWnd.getBounds().width * 0.8;
const height = parentWnd.getBounds().height * 0.8;
const printWin = new BrowserWindow({
parent: getWindowByContentId(event.sender.id),
modal: true,
parent: parentWnd,
modal: false,
show: true,
width: Math.floor(screen.getPrimaryDisplay().size.width * 0.8),
height: Math.floor(screen.getPrimaryDisplay().workAreaSize.height * 0.8),
width: width,
height: height,
resizable: false,
frame: "darwin" === process.platform,
icon: path.join(appDir, "stage", "icon-large.png"),