mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +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,
|
||||
spellcheck: spellcheckEnabled
|
||||
},
|
||||
frame: optionService.getOptionBool('nativeTitleBarVisible'),
|
||||
...getWindowExtraOpts(),
|
||||
icon: getIcon()
|
||||
});
|
||||
|
||||
@ -71,11 +71,7 @@ async function createMainWindow(app: App) {
|
||||
|
||||
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({
|
||||
x: mainWindowState.x,
|
||||
@ -90,7 +86,7 @@ async function createMainWindow(app: App) {
|
||||
webviewTag: true
|
||||
},
|
||||
icon: getIcon(),
|
||||
...extraOpts
|
||||
...getWindowExtraOpts()
|
||||
});
|
||||
|
||||
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) {
|
||||
remoteMain.enable(webContents);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user