提交 fb501864 编写于 作者: S Sandeep Somavarapu

Fix #57294

上级 387c79f8
......@@ -143,6 +143,7 @@ export class CompositeBar extends Widget implements ICompositeBar {
hideComposite(id: string): void {
if (this.model.hide(id)) {
this.updateCompositeSwitcher();
this.resetActiveComposite(id);
}
}
......@@ -196,34 +197,38 @@ export class CompositeBar extends Widget implements ICompositeBar {
this.updateCompositeSwitcher();
const defaultCompositeId = this.options.getDefaultCompositeId();
this.resetActiveComposite(compositeId);
}
}
// Case: composite is not the active one or the active one is a different one
// Solv: we do nothing
if (!this.model.activeItem || this.model.activeItem.id !== compositeId) {
return;
}
private resetActiveComposite(compositeId: string) {
const defaultCompositeId = this.options.getDefaultCompositeId();
// Deactivate itself
this.deactivateComposite(compositeId);
// Case: composite is not the active one or the active one is a different one
// Solv: we do nothing
if (!this.model.activeItem || this.model.activeItem.id !== compositeId) {
return;
}
// Case: composite is not the default composite and default composite is still showing
// Solv: we open the default composite
if (defaultCompositeId !== compositeId && this.isPinned(defaultCompositeId)) {
this.options.openComposite(defaultCompositeId);
}
// Deactivate itself
this.deactivateComposite(compositeId);
// Case: we closed the last visible composite
// Solv: we hide the part
else if (this.visibleComposites.length === 1) {
this.options.hidePart();
}
// Case: composite is not the default composite and default composite is still showing
// Solv: we open the default composite
if (defaultCompositeId !== compositeId && this.isPinned(defaultCompositeId)) {
this.options.openComposite(defaultCompositeId);
}
// Case: we closed the default composite
// Solv: we open the next visible composite from top
else {
this.options.openComposite(this.visibleComposites.filter(cid => cid !== compositeId)[0]);
}
// Case: we closed the last visible composite
// Solv: we hide the part
else if (this.visibleComposites.length === 1) {
this.options.hidePart();
}
// Case: we closed the default composite
// Solv: we open the next visible composite from top
else {
this.options.openComposite(this.visibleComposites.filter(cid => cid !== compositeId)[0]);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册