mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 00:36:10 +01:00
This commit is contained in:
parent
07645e2e86
commit
bd2b35320f
3 changed files with 47 additions and 23 deletions
29
app/src/window/openNewWindow.ts
Normal file
29
app/src/window/openNewWindow.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import {layoutToJSON} from "../layout/util";
|
||||
/// #if !BROWSER
|
||||
import {BrowserWindow} from "@electron/remote";
|
||||
import * as path from "path";
|
||||
/// #endif
|
||||
import {Constants} from "../constants";
|
||||
import {Tab} from "../layout/Tab";
|
||||
|
||||
export const openNewWindow = (tab: Tab) => {
|
||||
const win = new BrowserWindow({
|
||||
show: true,
|
||||
trafficLightPosition: {x: 8, y: 13},
|
||||
width: 1032,
|
||||
height: 650,
|
||||
frame: "darwin" === window.siyuan.config.system.os,
|
||||
icon: path.join(window.siyuan.config.system.appDir, "stage", "icon-large.png"),
|
||||
titleBarStyle: "hidden",
|
||||
webPreferences: {
|
||||
contextIsolation: false,
|
||||
nodeIntegration: true,
|
||||
webviewTag: true,
|
||||
webSecurity: false,
|
||||
},
|
||||
});
|
||||
const json = {};
|
||||
layoutToJSON(tab, json);
|
||||
win.loadURL(`${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${JSON.stringify(json)}`);
|
||||
tab.parent.removeTab(tab.id);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue