equate editor area hidden with maximized panel

fixes #78175
This commit is contained in:
SteVen Batten 2019-08-27 17:17:34 -07:00
parent 6a36998bac
commit e493a50a3b
2 changed files with 16 additions and 5 deletions

View file

@ -234,8 +234,7 @@ export class ToggleEditorVisibilityAction extends Action {
}
run(): Promise<any> {
const hideEditor = this.layoutService.isVisible(Parts.EDITOR_PART);
this.layoutService.setEditorHidden(hideEditor);
this.layoutService.toggleMaximizedPanel();
return Promise.resolve();
}

View file

@ -220,8 +220,15 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private registerLayoutListeners(): void {
// Restore editor if hidden and it changes
this._register(this.editorService.onDidVisibleEditorsChange(() => this.setEditorHidden(false)));
this._register(this.editorGroupService.onDidActivateGroup(() => this.setEditorHidden(false)));
const showEditorIfHidden = () => {
if (this.state.editor.hidden) {
this.toggleMaximizedPanel();
}
};
this._register(this.editorService.onDidVisibleEditorsChange(showEditorIfHidden));
this._register(this.editorGroupService.onDidActivateGroup(showEditorIfHidden));
// Configuration changes
this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration()));
@ -1110,7 +1117,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
if (this.workbenchGrid instanceof Grid) {
const size = this.workbenchGrid.getViewSize(this.panelPartView);
if (!this.isPanelMaximized()) {
this.state.panel.sizeBeforeMaximize = this.state.panel.position === Position.BOTTOM ? size.height : size.width;
if (this.state.panel.hidden) {
this.state.panel.sizeBeforeMaximize = this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView) || this.panelPartView.minimumHeight;
} else {
this.state.panel.sizeBeforeMaximize = this.state.panel.position === Position.BOTTOM ? size.height : size.width;
}
this.storageService.store(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, this.state.panel.sizeBeforeMaximize, StorageScope.GLOBAL);
this.setEditorHidden(true);
} else {