提交 e493a50a 编写于 作者: S SteVen Batten

equate editor area hidden with maximized panel

fixes #78175
上级 6a36998b
......@@ -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();
}
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册