mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 02:43:11 -05:00
fixes #54877
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user