mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
add alwaysUseContainerInfo for built-in viewlets
This commit is contained in:
@@ -47,6 +47,8 @@ export interface IViewContainerDescriptor {
|
||||
|
||||
readonly icon?: string | URI;
|
||||
|
||||
readonly alwaysUseContainerInfo?: boolean;
|
||||
|
||||
readonly order?: number;
|
||||
|
||||
readonly focusCommand?: { id: string, keybindings?: IKeybindings };
|
||||
|
||||
@@ -75,6 +75,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewCo
|
||||
name: nls.localize('run', "Run"),
|
||||
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
|
||||
icon: 'codicon-debug-alt-2',
|
||||
alwaysUseContainerInfo: true,
|
||||
order: 2
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegis
|
||||
icon: 'codicon-extensions',
|
||||
order: 4,
|
||||
rejectAddedViews: true,
|
||||
alwaysUseContainerInfo: true
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
|
||||
|
||||
@@ -263,6 +263,7 @@ export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry
|
||||
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
|
||||
storageId: 'workbench.explorer.views.state',
|
||||
icon: Codicon.files.classNames,
|
||||
alwaysUseContainerInfo: true,
|
||||
order: 0
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegis
|
||||
ctorDescriptor: new SyncDescriptor(SCMViewPaneContainer),
|
||||
storageId: 'workbench.scm.views.state',
|
||||
icon: Codicon.sourceControl.classNames,
|
||||
alwaysUseContainerInfo: true,
|
||||
order: 2
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ export class ViewContainerModel extends Disposable implements IViewContainerMode
|
||||
|
||||
private updateContainerInfo(): void {
|
||||
/* Use default container info if one of the visible view descriptors belongs to the current container by default */
|
||||
const useDefaultContainerInfo = this.visibleViewDescriptors.length === 0 || this.visibleViewDescriptors.some(v => Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).getViewContainer(v.id) === this.container);
|
||||
const useDefaultContainerInfo = this.container.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || this.visibleViewDescriptors.some(v => Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).getViewContainer(v.id) === this.container);
|
||||
const title = useDefaultContainerInfo ? this.container.name : this.visibleViewDescriptors[0]?.name || '';
|
||||
let titleChanged: boolean = false;
|
||||
if (this._title !== title) {
|
||||
|
||||
Reference in New Issue
Block a user