better explorer aria label #90446

This commit is contained in:
isidor 2020-02-13 15:10:53 +01:00
parent 2b3fed13e1
commit 55d1af3e68
2 changed files with 3 additions and 2 deletions

View file

@ -50,7 +50,7 @@ export class EmptyView extends ViewPane {
@IContextKeyService contextKeyService: IContextKeyService,
@IOpenerService openerService: IOpenerService
) {
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('explorerSection', "Explorer Section: No Folder Opened") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
this._register(this.contextService.onDidChangeWorkbenchState(() => this.setLabels()));
this._register(this.labelService.onDidChangeFormatters(() => this.setLabels()));
}

View file

@ -172,7 +172,7 @@ export class ExplorerView extends ViewPane {
@IFileService private readonly fileService: IFileService,
@IOpenerService openerService: IOpenerService,
) {
super({ ...(options as IViewPaneOptions), id: ExplorerView.ID, ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
super({ ...(options as IViewPaneOptions), id: ExplorerView.ID, ariaHeaderLabel: nls.localize('explorerSection', "Explorer Section: {0}", labelService.getWorkspaceLabel(contextService.getWorkspace())) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
this.resourceContext = instantiationService.createInstance(ResourceContextKey);
this._register(this.resourceContext);
@ -229,6 +229,7 @@ export class ExplorerView extends ViewPane {
const title = workspace.folders.map(folder => folder.name).join();
titleElement.textContent = this.name;
titleElement.title = title;
titleElement.setAttribute('aria-label', nls.localize('explorerSection', "Explorer Section: {0}", this.name));
};
this._register(this.contextService.onDidChangeWorkspaceName(setHeader));