mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
parent
6a36998bac
commit
e493a50a3b
|
@ -234,8 +234,7 @@ export class ToggleEditorVisibilityAction extends Action {
|
||||||
}
|
}
|
||||||
|
|
||||||
run(): Promise<any> {
|
run(): Promise<any> {
|
||||||
const hideEditor = this.layoutService.isVisible(Parts.EDITOR_PART);
|
this.layoutService.toggleMaximizedPanel();
|
||||||
this.layoutService.setEditorHidden(hideEditor);
|
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,8 +220,15 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||||
private registerLayoutListeners(): void {
|
private registerLayoutListeners(): void {
|
||||||
|
|
||||||
// Restore editor if hidden and it changes
|
// Restore editor if hidden and it changes
|
||||||
this._register(this.editorService.onDidVisibleEditorsChange(() => this.setEditorHidden(false)));
|
const showEditorIfHidden = () => {
|
||||||
this._register(this.editorGroupService.onDidActivateGroup(() => this.setEditorHidden(false)));
|
if (this.state.editor.hidden) {
|
||||||
|
this.toggleMaximizedPanel();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this._register(this.editorService.onDidVisibleEditorsChange(showEditorIfHidden));
|
||||||
|
this._register(this.editorGroupService.onDidActivateGroup(showEditorIfHidden));
|
||||||
|
|
||||||
// Configuration changes
|
// Configuration changes
|
||||||
this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration()));
|
this._register(this.configurationService.onDidChangeConfiguration(() => this.doUpdateLayoutConfiguration()));
|
||||||
|
@ -1110,7 +1117,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||||
if (this.workbenchGrid instanceof Grid) {
|
if (this.workbenchGrid instanceof Grid) {
|
||||||
const size = this.workbenchGrid.getViewSize(this.panelPartView);
|
const size = this.workbenchGrid.getViewSize(this.panelPartView);
|
||||||
if (!this.isPanelMaximized()) {
|
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.storageService.store(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, this.state.panel.sizeBeforeMaximize, StorageScope.GLOBAL);
|
||||||
this.setEditorHidden(true);
|
this.setEditorHidden(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue