This commit is contained in:
SteVen Batten
2018-07-29 21:05:17 -07:00
parent 8922069381
commit 64c433bf2b

View File

@@ -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();
}
}
}