From 64c433bf2bd43c85d1bfe5753bb6fb90ff4be14a Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Sun, 29 Jul 2018 21:05:17 -0700 Subject: [PATCH] fixes #54877 --- .../browser/parts/titlebar/titlebarPart.ts | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 3eedcb97500..4fae75a06ea 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -54,6 +54,7 @@ export class TitlebarPart extends Part implements ITitleService { private appIcon: Builder; private menubarPart: MenubarPart; private menubar: Builder; + private resizer: Builder; private pendingTitle: string; private representedFileName: string; @@ -334,12 +335,12 @@ export class TitlebarPart extends Part implements ITitleService { this.windowService.closeWindow().then(null, errors.onUnexpectedError); }); + // Resizer + this.resizer = $(this.titleContainer).div({ class: 'resizer' }); + const isMaximized = this.windowService.getConfiguration().maximized ? true : false; this.onDidChangeMaximized(isMaximized); this.windowService.onDidChangeMaximize(this.onDidChangeMaximized, this); - - // Resizer - $(this.titleContainer).div({ class: 'resizer' }); } // Since the title area is used to drag the window, we do not want to steal focus from the @@ -357,16 +358,22 @@ export class TitlebarPart extends Part implements ITitleService { } private onDidChangeMaximized(maximized: boolean) { - if (!this.maxRestoreControl) { - return; + if (this.maxRestoreControl) { + if (maximized) { + this.maxRestoreControl.removeClass('window-maximize'); + this.maxRestoreControl.addClass('window-unmaximize'); + } else { + this.maxRestoreControl.removeClass('window-unmaximize'); + this.maxRestoreControl.addClass('window-maximize'); + } } - if (maximized) { - this.maxRestoreControl.removeClass('window-maximize'); - this.maxRestoreControl.addClass('window-unmaximize'); - } else { - this.maxRestoreControl.removeClass('window-unmaximize'); - this.maxRestoreControl.addClass('window-maximize'); + if (this.resizer) { + if (maximized) { + this.resizer.hide(); + } else { + this.resizer.show(); + } } }