SDA-2016: fix simplified installer issues (#986)

- update the background image on macOS installer to support dark mode
- fix issues with saving window position on welcome screen

Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
Vishwas Shashidhar
2020-05-06 13:16:20 +05:30
committed by GitHub
parent d8c0e23a87
commit f09b5a8996
5 changed files with 32 additions and 22 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

+1 -17
View File
@@ -546,23 +546,7 @@
<key>APPAREANCES</key>
<dict>
<key>DARK_AQUA</key>
<dict>
<key>ALIGNMENT</key>
<integer>4</integer>
<key>BACKGROUND_PATH</key>
<dict>
<key>PATH</key>
<string>background.png</string>
<key>PATH_TYPE</key>
<integer>3</integer>
</dict>
<key>CUSTOM</key>
<true/>
<key>LAYOUT_DIRECTION</key>
<integer>0</integer>
<key>SCALING</key>
<integer>1</integer>
</dict>
<dict/>
<key>LIGHT_AQUA</key>
<dict>
<key>ALIGNMENT</key>
+5
View File
@@ -83,6 +83,11 @@ class VersionHandler {
const hostname = nodeURL.parse(this.mainUrl).hostname;
const protocol = nodeURL.parse(this.mainUrl).protocol;
if (protocol && protocol.startsWith('file')) {
return;
}
const versionApiPath = '/webcontroller/HealthCheck/version/advanced';
const url = `${protocol}//${hostname}${versionApiPath}`;
+4
View File
@@ -223,6 +223,10 @@ const setSpecificAlwaysOnTop = () => {
* @param window {BrowserWindow}
*/
export const monitorWindowActions = (window: BrowserWindow): void => {
if (windowHandler.shouldShowWelcomeScreen) {
logger.info(`Not saving window position as we are showing the welcome window!`);
return;
}
if (!window || window.isDestroyed()) {
return;
}
+22 -5
View File
@@ -83,6 +83,7 @@ export class WindowHandler {
public isCustomTitleBar: boolean;
public isWebPageLoading: boolean = true;
public screenShareIndicatorFrameUtil: string;
public shouldShowWelcomeScreen: boolean = false;
private readonly contextIsolation: boolean;
private readonly backgroundThrottling: boolean;
@@ -93,7 +94,6 @@ export class WindowHandler {
// Window reference
private readonly windows: object;
private shouldShowWelcomeScreen: boolean = false;
private loadFailError: string | undefined;
private mainWindow: ICustomBrowserWindow | null = null;
private aboutAppWindow: Electron.BrowserWindow | null = null;
@@ -164,7 +164,6 @@ export class WindowHandler {
*/
public async createApplication() {
await this.updateVersionInfo();
this.spellchecker = new SpellChecker();
logger.info(`window-handler: initialized spellchecker module with locale ${this.spellchecker.locale}`);
@@ -184,6 +183,22 @@ export class WindowHandler {
this.windowOpts.resizable = false;
this.windowOpts.maximizable = false;
this.windowOpts.fullscreenable = false;
if (this.config.mainWinPos && this.config.mainWinPos.height) {
this.config.mainWinPos.height = DEFAULT_HEIGHT;
}
if (this.config.mainWinPos && this.config.mainWinPos.width) {
this.config.mainWinPos.width = DEFAULT_WIDTH;
}
if (this.config.mainWinPos && this.config.mainWinPos.x) {
this.config.mainWinPos.x = undefined;
}
if (this.config.mainWinPos && this.config.mainWinPos.y) {
this.config.mainWinPos.y = undefined;
}
}
// set window opts with additional config
@@ -250,9 +265,11 @@ export class WindowHandler {
this.handleWelcomeScreen();
}
// loads the main window with url from config/cmd line
this.mainWindow.loadURL(this.url);
await this.mainWindow.loadURL(this.url);
// check for build expiry in case of test builds
this.checkExpiry(this.mainWindow);
await this.checkExpiry(this.mainWindow);
// update version info from server
this.updateVersionInfo();
// need this for postMessage origin
this.mainWindow.origin = this.url;
@@ -445,7 +462,7 @@ export class WindowHandler {
});
ipcMain.on('set-pod-url', async (_event, newPodUrl: string) => {
await config.updateUserConfig({url: newPodUrl, mainWinPos: { ...this.mainWindow!.getPosition(), ...{ height: 900, width: 900 } } });
await config.updateUserConfig({url: newPodUrl});
app.relaunch();
app.exit();
});