mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-22 08:57:00 -06:00
ELECTRON-1396 & ELECTRON-1429 - Fix window constructor opts (#744)
This commit is contained in:
parent
1d9146ff02
commit
f8ea6a778f
@ -1,5 +1,5 @@
|
||||
import * as electron from 'electron';
|
||||
import { app, BrowserWindow, crashReporter, globalShortcut, ipcMain } from 'electron';
|
||||
import { app, BrowserWindow, BrowserWindowConstructorOptions, crashReporter, globalShortcut, ipcMain } from 'electron';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { format, parse } from 'url';
|
||||
@ -397,10 +397,21 @@ export class WindowHandler {
|
||||
return (window as ICustomBrowserWindow).winName === windowName;
|
||||
});
|
||||
|
||||
this.aboutAppWindow = createComponentWindow(
|
||||
'about-app',
|
||||
selectedParentWindow ? { parent: selectedParentWindow } : {},
|
||||
);
|
||||
const opts: BrowserWindowConstructorOptions = this.getWindowOpts({
|
||||
modal: true,
|
||||
}, {
|
||||
devTools: false,
|
||||
});
|
||||
|
||||
if (this.mainWindow && windowExists(this.mainWindow) && this.mainWindow.isAlwaysOnTop()) {
|
||||
opts.alwaysOnTop = true;
|
||||
}
|
||||
|
||||
if (selectedParentWindow) {
|
||||
opts.parent = selectedParentWindow;
|
||||
}
|
||||
|
||||
this.aboutAppWindow = createComponentWindow('about-app', opts);
|
||||
this.aboutAppWindow.setVisibleOnAllWorkspaces(true);
|
||||
this.aboutAppWindow.webContents.once('did-finish-load', async () => {
|
||||
if (!this.aboutAppWindow || !windowExists(this.aboutAppWindow)) {
|
||||
@ -425,7 +436,17 @@ export class WindowHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
this.moreInfoWindow = createComponentWindow('more-info', { width: 550, height: 500 });
|
||||
const opts: BrowserWindowConstructorOptions = this.getWindowOpts({
|
||||
width: 550,
|
||||
height: 500,
|
||||
}, {
|
||||
devTools: false,
|
||||
});
|
||||
if (this.mainWindow && windowExists(this.mainWindow) && this.mainWindow.isAlwaysOnTop()) {
|
||||
opts.alwaysOnTop = true;
|
||||
}
|
||||
|
||||
this.moreInfoWindow = createComponentWindow('more-info', opts);
|
||||
this.moreInfoWindow.webContents.once('did-finish-load', async () => {
|
||||
if (!this.moreInfoWindow || !windowExists(this.moreInfoWindow)) {
|
||||
return;
|
||||
@ -448,16 +469,22 @@ export class WindowHandler {
|
||||
this.screenPickerWindow.close();
|
||||
}
|
||||
|
||||
const opts = this.getWindowOpts({
|
||||
const opts: ICustomBrowserWindowConstructorOpts = this.getWindowOpts({
|
||||
alwaysOnTop: true,
|
||||
autoHideMenuBar: true,
|
||||
frame: false,
|
||||
modal: true,
|
||||
height: isMac ? 519 : 523,
|
||||
width: 580,
|
||||
show: false,
|
||||
}, {
|
||||
devTools: false,
|
||||
});
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
if (focusedWindow && windowExists(focusedWindow) && isWindowsOS) {
|
||||
opts.parent = focusedWindow;
|
||||
}
|
||||
|
||||
this.screenPickerWindow = createComponentWindow('screen-picker', opts);
|
||||
this.screenPickerWindow.webContents.once('did-finish-load', () => {
|
||||
if (!this.screenPickerWindow || !windowExists(this.screenPickerWindow)) {
|
||||
@ -639,6 +666,7 @@ export class WindowHandler {
|
||||
autoHideMenuBar: true,
|
||||
resizable: false,
|
||||
alwaysOnTop: true,
|
||||
fullscreenable: false,
|
||||
}, {
|
||||
devTools: false,
|
||||
}), ...{ winKey: streamId },
|
||||
|
Loading…
Reference in New Issue
Block a user