Skip to content

Commit

Permalink
feat add window title separator prop (#94371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Heilemann committed Apr 7, 2020
1 parent 7ce62c0 commit 84ed4b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class TitlebarPart extends Part implements ITitleService {
private static readonly NLS_USER_IS_ADMIN = isWindows ? nls.localize('userIsAdmin', "[Administrator]") : nls.localize('userIsSudo', "[Superuser]");
private static readonly NLS_EXTENSION_HOST = nls.localize('devExtensionWindowTitlePrefix', "[Extension Development Host]");
private static readonly TITLE_DIRTY = '\u25cf ';
private static readonly TITLE_SEPARATOR = isMacintosh ? ' — ' : ' - '; // macOS uses special - separator

//#region IView

Expand Down Expand Up @@ -126,7 +125,7 @@ export class TitlebarPart extends Part implements ITitleService {
}

protected onConfigurationChanged(event: IConfigurationChangeEvent): void {
if (event.affectsConfiguration('window.title')) {
if (event.affectsConfiguration('window.title') || event.affectsConfiguration('window.titleSeparator')) {
this.titleUpdater.schedule();
}

Expand Down Expand Up @@ -283,7 +282,7 @@ export class TitlebarPart extends Part implements ITitleService {
const dirty = editor?.isDirty() && !editor.isSaving() ? TitlebarPart.TITLE_DIRTY : '';
const appName = this.productService.nameLong;
const remoteName = this.labelService.getHostLabel(REMOTE_HOST_SCHEME, this.environmentService.configuration.remoteAuthority);
const separator = TitlebarPart.TITLE_SEPARATOR;
const separator = this.configurationService.getValue<string>('window.titleSeparator');
const titleTemplate = this.configurationService.getValue<string>('window.title');

return template(titleTemplate, {
Expand Down
5 changes: 5 additions & 0 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio
})(),
'markdownDescription': windowTitleDescription
},
'window.titleSeparator': {
'type': 'string',
'default': isMacintosh ? ' — ' : ' - ',
'markdownDescription': nls.localize("window.titleSeparator", "Separator used by `window.title`.")
},
'window.menuBarVisibility': {
'type': 'string',
'enum': ['default', 'visible', 'toggle', 'hidden', 'compact'],
Expand Down

0 comments on commit 84ed4b5

Please sign in to comment.