From bd54d632d98d8326ecb920ea589c3979f5fadd05 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 8 Feb 2023 12:02:51 +0100 Subject: [PATCH] Remove never changing constructor params Window.main has a defaultWidth and defaultHeight that never change, so they do not need to get passed in from outside hideTitleBar is always true, so there is no need to make it a param --- apps/desktop/src/main.ts | 3 --- apps/desktop/src/main/window.main.ts | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index b5090c23696..bf84869d85e 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -98,9 +98,6 @@ export class Main { this.windowMain = new WindowMain( this.stateService, this.logService, - true, - undefined, - undefined, (arg) => this.processDeepLink(arg), (win) => this.trayMain.setupWindowListeners(win) ); diff --git a/apps/desktop/src/main/window.main.ts b/apps/desktop/src/main/window.main.ts index b1d88a821f4..e4489f70203 100644 --- a/apps/desktop/src/main/window.main.ts +++ b/apps/desktop/src/main/window.main.ts @@ -20,12 +20,12 @@ export class WindowMain { private windowStates: { [key: string]: WindowState } = {}; private enableAlwaysOnTop = false; + readonly defaultWidth = 950; + readonly defaultHeight = 600; + constructor( private stateService: StateService, private logService: LogService, - private hideTitleBar = false, - private defaultWidth = 950, - private defaultHeight = 600, private argvCallback: (argv: string[]) => void = null, private createWindowCallback: (win: BrowserWindow) => void ) {} @@ -118,7 +118,7 @@ export class WindowMain { y: this.windowStates[mainWindowSizeKey].y, title: app.name, icon: process.platform === "linux" ? path.join(__dirname, "/images/icon.png") : undefined, - titleBarStyle: this.hideTitleBar && process.platform === "darwin" ? "hiddenInset" : undefined, + titleBarStyle: process.platform === "darwin" ? "hiddenInset" : undefined, show: false, backgroundColor: "#fff", alwaysOnTop: this.enableAlwaysOnTop,