@@ -54,6 +54,7 @@ export class TitlebarPart extends Part implements ITitleService {
5454 private appIcon : Builder ;
5555 private menubarPart : MenubarPart ;
5656 private menubar : Builder ;
57+ private resizer : Builder ;
5758
5859 private pendingTitle : string ;
5960 private representedFileName : string ;
@@ -334,12 +335,12 @@ export class TitlebarPart extends Part implements ITitleService {
334335 this . windowService . closeWindow ( ) . then ( null , errors . onUnexpectedError ) ;
335336 } ) ;
336337
338+ // Resizer
339+ this . resizer = $ ( this . titleContainer ) . div ( { class : 'resizer' } ) ;
340+
337341 const isMaximized = this . windowService . getConfiguration ( ) . maximized ? true : false ;
338342 this . onDidChangeMaximized ( isMaximized ) ;
339343 this . windowService . onDidChangeMaximize ( this . onDidChangeMaximized , this ) ;
340-
341- // Resizer
342- $ ( this . titleContainer ) . div ( { class : 'resizer' } ) ;
343344 }
344345
345346 // 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 {
357358 }
358359
359360 private onDidChangeMaximized ( maximized : boolean ) {
360- if ( ! this . maxRestoreControl ) {
361- return ;
361+ if ( this . maxRestoreControl ) {
362+ if ( maximized ) {
363+ this . maxRestoreControl . removeClass ( 'window-maximize' ) ;
364+ this . maxRestoreControl . addClass ( 'window-unmaximize' ) ;
365+ } else {
366+ this . maxRestoreControl . removeClass ( 'window-unmaximize' ) ;
367+ this . maxRestoreControl . addClass ( 'window-maximize' ) ;
368+ }
362369 }
363370
364- if ( maximized ) {
365- this . maxRestoreControl . removeClass ( 'window-maximize' ) ;
366- this . maxRestoreControl . addClass ( 'window-unmaximize' ) ;
367- } else {
368- this . maxRestoreControl . removeClass ( 'window-unmaximize' ) ;
369- this . maxRestoreControl . addClass ( 'window-maximize' ) ;
371+ if ( this . resizer ) {
372+ if ( maximized ) {
373+ this . resizer . hide ( ) ;
374+ } else {
375+ this . resizer . show ( ) ;
376+ }
370377 }
371378 }
372379
0 commit comments