mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 02:42:27 +08:00
fix(native-buttons): enable buttons on other windows as well
This commit is contained in:
parent
229825d99c
commit
45faa666ba
@ -31,7 +31,7 @@ async function createExtraWindow(extraWindowHash: string) {
|
|||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
spellcheck: spellcheckEnabled
|
spellcheck: spellcheckEnabled
|
||||||
},
|
},
|
||||||
frame: optionService.getOptionBool('nativeTitleBarVisible'),
|
...getWindowExtraOpts(),
|
||||||
icon: getIcon()
|
icon: getIcon()
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -71,11 +71,7 @@ async function createMainWindow(app: App) {
|
|||||||
|
|
||||||
const { BrowserWindow } = (await import('electron')); // should not be statically imported
|
const { BrowserWindow } = (await import('electron')); // should not be statically imported
|
||||||
|
|
||||||
const extraOpts: Partial<BrowserWindowConstructorOptions> = {};
|
|
||||||
if (!optionService.getOptionBool('nativeTitleBarVisible')) {
|
|
||||||
extraOpts.titleBarStyle = "hidden";
|
|
||||||
extraOpts.titleBarOverlay = (process.platform !== "darwin");
|
|
||||||
}
|
|
||||||
|
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
x: mainWindowState.x,
|
x: mainWindowState.x,
|
||||||
@ -90,7 +86,7 @@ async function createMainWindow(app: App) {
|
|||||||
webviewTag: true
|
webviewTag: true
|
||||||
},
|
},
|
||||||
icon: getIcon(),
|
icon: getIcon(),
|
||||||
...extraOpts
|
...getWindowExtraOpts()
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindowState.manage(mainWindow);
|
mainWindowState.manage(mainWindow);
|
||||||
@ -116,6 +112,16 @@ async function createMainWindow(app: App) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getWindowExtraOpts() {
|
||||||
|
const extraOpts: Partial<BrowserWindowConstructorOptions> = {};
|
||||||
|
if (!optionService.getOptionBool('nativeTitleBarVisible')) {
|
||||||
|
extraOpts.titleBarStyle = "hidden";
|
||||||
|
extraOpts.titleBarOverlay = (process.platform !== "darwin");
|
||||||
|
}
|
||||||
|
|
||||||
|
return extraOpts;
|
||||||
|
}
|
||||||
|
|
||||||
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
|
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
|
||||||
remoteMain.enable(webContents);
|
remoteMain.enable(webContents);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user