diff --git a/src/vs/platform/statusbar/common/statusbar.ts b/src/vs/platform/statusbar/common/statusbar.ts index 710cf3fde02..5d6fde91462 100644 --- a/src/vs/platform/statusbar/common/statusbar.ts +++ b/src/vs/platform/statusbar/common/statusbar.ts @@ -15,20 +15,20 @@ export const enum StatusbarAlignment { RIGHT } -export interface IStatusbarEntryCategory { - id: string; - label: string; -} - /** * A declarative way of describing a status bar entry */ export interface IStatusbarEntry { /** - * The category of the entry is needed to allow users to hide entries via settings. + * The identifier of the entry is needed to allow users to hide entries via settings. */ - readonly category: IStatusbarEntryCategory; + readonly id: string; + + /** + * A human readable name the entry is about. + */ + readonly name: string; /** * The text to show for the entry. You can embed icons in the text by leveraging the syntax: diff --git a/src/vs/workbench/api/browser/mainThreadStatusBar.ts b/src/vs/workbench/api/browser/mainThreadStatusBar.ts index dca3f140600..255fb6abe57 100644 --- a/src/vs/workbench/api/browser/mainThreadStatusBar.ts +++ b/src/vs/workbench/api/browser/mainThreadStatusBar.ts @@ -28,10 +28,8 @@ export class MainThreadStatusBar implements MainThreadStatusBarShape { $setEntry(id: number, extension: IExtensionDescription, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { const entry: IStatusbarEntry = { - category: { - id: extension.identifier.value, - label: localize('extensionLabel', "{0} (Extension)", extension.displayName || extension.name) - }, + id: extension.identifier.value, + name: localize('extensionLabel', "{0} (Extension)", extension.displayName || extension.name), text, tooltip, command, diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 3a7d965ea56..89069d27646 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -223,7 +223,8 @@ registerEditorContribution(OpenWorkspaceButtonContribution); const statusBar = Registry.as(StatusExtensions.Statusbar); statusBar.registerStatusbarItem(new StatusbarItemDescriptor( EditorStatus, - { id: 'status.editor', label: nls.localize('status.editor', "Editor Status") }, + 'status.editor', + nls.localize('status.editor', "Editor Status"), StatusbarAlignment.RIGHT, 100 /* towards the left of the right hand side */ )); @@ -231,7 +232,8 @@ statusBar.registerStatusbarItem(new StatusbarItemDescriptor( // Register Zoom Status statusBar.registerStatusbarItem(new StatusbarItemDescriptor( ZoomStatusbarItem, - { id: 'status.imageZoom', label: nls.localize('status.imageZoom', "Image Zoom") }, + 'status.imageZoom', + nls.localize('status.imageZoom', "Image Zoom"), StatusbarAlignment.RIGHT, 101 /* to the left of editor status (100) */) ); diff --git a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts index efda5fd80e3..fa69e03408d 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts @@ -58,7 +58,8 @@ export class NotificationsStatus extends Disposable { private updateNotificationsCenterStatusItem(): void { const statusProperties: IStatusbarEntry = { - category: { id: 'status.notifications', label: localize('status.notifications', "Notifictions") }, + id: 'status.notifications', + name: localize('status.notifications', "Notifictions"), text: this.currentNotifications.size === 0 ? '$(bell)' : `$(bell) ${this.currentNotifications.size}`, command: this.isNotificationsCenterVisible ? HIDE_NOTIFICATIONS_CENTER : SHOW_NOTIFICATIONS_CENTER, tooltip: this.getTooltip(), @@ -139,7 +140,8 @@ export class NotificationsStatus extends Disposable { let statusMessageEntry: IStatusbarEntryAccessor; let showHandle: any = setTimeout(() => { statusMessageEntry = this.statusbarService.addEntry({ - category: { id: 'status.message', label: localize('status.message', "Status Message") }, + id: 'status.message', + name: localize('status.message', "Status Message"), text: message }, StatusbarAlignment.LEFT, -Number.MAX_VALUE /* far right on left hand side */); showHandle = null; diff --git a/src/vs/workbench/browser/parts/statusbar/statusbar.ts b/src/vs/workbench/browser/parts/statusbar/statusbar.ts index d1f753e4cdd..7f1c7b5cb37 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbar.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbar.ts @@ -5,7 +5,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { StatusbarAlignment, IStatusbarEntryCategory } from 'vs/platform/statusbar/common/statusbar'; +import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { SyncDescriptor0, createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; @@ -15,17 +15,20 @@ export interface IStatusbarItem { export class StatusbarItemDescriptor { readonly syncDescriptor: SyncDescriptor0; - readonly category: IStatusbarEntryCategory; + readonly id: string; + readonly name: string; readonly alignment: StatusbarAlignment; readonly priority: number; constructor( ctor: IConstructorSignature0, - category: IStatusbarEntryCategory, + id: string, + name: string, alignment?: StatusbarAlignment, priority?: number ) { - this.category = category; + this.id = id; + this.name = name; this.syncDescriptor = createSyncDescriptor(ctor); this.alignment = alignment || StatusbarAlignment.LEFT; this.priority = priority || 0; diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index cbc2a350f19..5614ff23fee 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -15,7 +15,7 @@ import { Part } from 'vs/workbench/browser/part'; import { IStatusbarRegistry, Extensions } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarEntryCategory } from 'vs/platform/statusbar/common/statusbar'; +import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntryAccessor } from 'vs/platform/statusbar/common/statusbar'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { Action, IAction } from 'vs/base/common/actions'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector, ThemeColor } from 'vs/platform/theme/common/themeService'; @@ -44,22 +44,23 @@ interface IPendingStatusbarEntry { } interface IStatusbarViewModelItem { - category: IStatusbarEntryCategory; + id: string; + name: string; alignment: StatusbarAlignment; priority: number; } class StatusbarViewModel extends Disposable { - private static readonly HIDDEN_CATEGORIES_KEY = 'workbench.statusbar.hidden'; + private static readonly HIDDEN_ENTRIES_KEY = 'workbench.statusbar.hidden'; private readonly _items: IStatusbarViewModelItem[] = []; get items(): IStatusbarViewModelItem[] { return this._items; } - private readonly _onDidCategoryVisibilityChange: Emitter = this._register(new Emitter()); - get onDidCategoryVisibilityChange(): Event { return this._onDidCategoryVisibilityChange.event; } + private readonly _onDidVisibilityChange: Emitter = this._register(new Emitter()); + get onDidVisibilityChange(): Event { return this._onDidVisibilityChange.event; } - private hiddenCategories: Set; + private hidden: Set; constructor(private storageService: IStorageService) { super(); @@ -69,18 +70,18 @@ class StatusbarViewModel extends Disposable { } private restoreState(): void { - const hiddenCategoriesRaw = this.storageService.get(StatusbarViewModel.HIDDEN_CATEGORIES_KEY, StorageScope.GLOBAL); - if (hiddenCategoriesRaw) { + const hiddenRaw = this.storageService.get(StatusbarViewModel.HIDDEN_ENTRIES_KEY, StorageScope.GLOBAL); + if (hiddenRaw) { try { - const hiddenCategoriesArray: string[] = JSON.parse(hiddenCategoriesRaw); - this.hiddenCategories = new Set(hiddenCategoriesArray); + const hiddenArray: string[] = JSON.parse(hiddenRaw); + this.hidden = new Set(hiddenArray); } catch (error) { // ignore parsing errors } } - if (!this.hiddenCategories) { - this.hiddenCategories = new Set(); + if (!this.hidden) { + this.hidden = new Set(); } } @@ -89,38 +90,41 @@ class StatusbarViewModel extends Disposable { } private onDidStorageChange(event: IWorkspaceStorageChangeEvent): void { - if (event.key === StatusbarViewModel.HIDDEN_CATEGORIES_KEY && event.scope === StorageScope.GLOBAL) { + if (event.key === StatusbarViewModel.HIDDEN_ENTRIES_KEY && event.scope === StorageScope.GLOBAL) { - // Keep current hidden categories - const currentHiddenCategories = this.hiddenCategories; + // Keep current hidden entries + const currentlyHidden = new Set(this.hidden); - // Load latest state of hidden categories + // Load latest state of hidden entries + this.hidden.clear(); this.restoreState(); - const changedCategories = new Set(); + const changed = new Set(); - // Check for each category that is now visible - currentHiddenCategories.forEach(category => { - if (!this.hiddenCategories.has(category)) { - changedCategories.add(category); + // Check for each entry that is now visible + currentlyHidden.forEach(entry => { + if (!this.hidden.has(entry)) { + changed.add(entry); } }); - // Check for each category that is now hidden - this.hiddenCategories.forEach(category => { - if (!currentHiddenCategories.has(category)) { - changedCategories.add(category); + // Check for each entry that is now hidden + this.hidden.forEach(entry => { + if (!currentlyHidden.has(entry)) { + changed.add(entry); } }); - // Notify listeners that visibility for categories that changed - this._items.forEach(item => { - if (changedCategories.has(item.category.id)) { - this._onDidCategoryVisibilityChange.fire(item.category); + // Notify listeners that visibility for entries have changed + if (changed.size > 0) { + this._items.forEach(item => { + if (changed.has(item.id)) { + this._onDidVisibilityChange.fire(item.id); - changedCategories.delete(item.category.id); - } - }); + changed.delete(item.id); + } + }); + } } } @@ -136,35 +140,35 @@ class StatusbarViewModel extends Disposable { } } - isHidden(category: IStatusbarEntryCategory): boolean { - return this.hiddenCategories.has(category.id); + isHidden(id: string): boolean { + return this.hidden.has(id); } - hide(category: IStatusbarEntryCategory): void { - if (!this.hiddenCategories.has(category.id)) { - this.hiddenCategories.add(category.id); + hide(id: string): void { + if (!this.hidden.has(id)) { + this.hidden.add(id); - this._onDidCategoryVisibilityChange.fire(category); + this._onDidVisibilityChange.fire(id); this.saveState(); } } - show(category: IStatusbarEntryCategory): void { - if (this.hiddenCategories.has(category.id)) { - this.hiddenCategories.delete(category.id); + show(id: string): void { + if (this.hidden.has(id)) { + this.hidden.delete(id); - this._onDidCategoryVisibilityChange.fire(category); + this._onDidVisibilityChange.fire(id); this.saveState(); } } private saveState(): void { - if (this.hiddenCategories.size > 0) { - this.storageService.store(StatusbarViewModel.HIDDEN_CATEGORIES_KEY, JSON.stringify(values(this.hiddenCategories)), StorageScope.GLOBAL); + if (this.hidden.size > 0) { + this.storageService.store(StatusbarViewModel.HIDDEN_ENTRIES_KEY, JSON.stringify(values(this.hidden)), StorageScope.GLOBAL); } else { - this.storageService.remove(StatusbarViewModel.HIDDEN_CATEGORIES_KEY, StorageScope.GLOBAL); + this.storageService.remove(StatusbarViewModel.HIDDEN_ENTRIES_KEY, StorageScope.GLOBAL); } } @@ -187,33 +191,33 @@ class StatusbarViewModel extends Disposable { } } -class ToggleStatusCategoryVisibilityAction extends Action { +class ToggleStatusbarEntryVisibilityAction extends Action { - constructor(private category: IStatusbarEntryCategory, private model: StatusbarViewModel) { - super(category.id, category.label, undefined, true); + constructor(id: string, label: string, private model: StatusbarViewModel) { + super(id, label, undefined, true); - this.checked = !model.isHidden(category); + this.checked = !model.isHidden(id); } run(): Promise { - if (this.model.isHidden(this.category)) { - this.model.show(this.category); + if (this.model.isHidden(this.id)) { + this.model.show(this.id); } else { - this.model.hide(this.category); + this.model.hide(this.id); } return Promise.resolve(true); } } -class HideStatusCategoryAction extends Action { +class HideStatusbarEntryAction extends Action { - constructor(private category: IStatusbarEntryCategory, private model: StatusbarViewModel) { - super(category.id, nls.localize('hide', "Hide"), undefined, true); + constructor(id: string, private model: StatusbarViewModel) { + super(id, nls.localize('hide', "Hide"), undefined, true); } run(): Promise { - this.model.hide(this.category); + this.model.hide(this.id); return Promise.resolve(true); } @@ -225,7 +229,7 @@ export class StatusbarPart extends Part implements IStatusbarService { private static readonly PRIORITY_PROP = 'statusbar-item-priority'; private static readonly ALIGNMENT_PROP = 'statusbar-item-alignment'; - private static readonly CATEGORY_PROP = 'statusbar-item-category'; + private static readonly IDENTIFIER_PROP = 'statusbar-item-identifier'; //#region IView @@ -259,13 +263,13 @@ export class StatusbarPart extends Part implements IStatusbarService { private registerListeners(): void { this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateStyles())); - this._register(this.viewModel.onDidCategoryVisibilityChange(category => this.onDidCategoryVisibilityChange(category))); + this._register(this.viewModel.onDidVisibilityChange(id => this.onDidVisibilityChange(id))); } - private onDidCategoryVisibilityChange(category: IStatusbarEntryCategory): void { - const isHidden = this.viewModel.isHidden(category); + private onDidVisibilityChange(id: string): void { + const isHidden = this.viewModel.isHidden(id); - const items = this.getEntries(category); + const items = this.getEntries(id); items.forEach(item => { if (isHidden) { hide(item); @@ -315,11 +319,11 @@ export class StatusbarPart extends Part implements IStatusbarService { private doAddEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority: number): IStatusbarEntryAccessor { // Add to view model - const viewModelItem: IStatusbarViewModelItem = { category: entry.category, alignment, priority }; + const viewModelItem: IStatusbarViewModelItem = { id: entry.id, name: entry.name, alignment, priority }; this.viewModel.add(viewModelItem); // Render entry in status bar - const itemContainer = this.doCreateStatusItem(entry.category, alignment, priority, ...coalesce(['statusbar-entry', entry.showBeak ? 'has-beak' : undefined])); + const itemContainer = this.doCreateStatusItem(entry.id, entry.name, alignment, priority, ...coalesce(['statusbar-entry', entry.showBeak ? 'has-beak' : undefined])); const item = this.instantiationService.createInstance(StatusbarEntryItem, itemContainer, entry); // Insert according to priority @@ -363,7 +367,7 @@ export class StatusbarPart extends Part implements IStatusbarService { }; } - private getEntries(scope: StatusbarAlignment | IStatusbarEntryCategory): HTMLElement[] { + private getEntries(scope: StatusbarAlignment | string): HTMLElement[] { const entries: HTMLElement[] = []; const container = this.element; @@ -378,9 +382,9 @@ export class StatusbarPart extends Part implements IStatusbarService { } } - // By category + // By identifier else { - if (childElement.getAttribute(StatusbarPart.CATEGORY_PROP) === scope.id) { + if (childElement.getAttribute(StatusbarPart.IDENTIFIER_PROP) === scope) { entries.push(childElement); } } @@ -425,15 +429,15 @@ export class StatusbarPart extends Part implements IStatusbarService { }); // Fill in initial items that were contributed from the registry - for (const { category, alignment, priority, syncDescriptor } of descriptors) { + for (const { id, name, alignment, priority, syncDescriptor } of descriptors) { // Add to view model - const viewModelItem: IStatusbarViewModelItem = { category, alignment, priority }; + const viewModelItem: IStatusbarViewModelItem = { id, name, alignment, priority }; this.viewModel.add(viewModelItem); // Render const item = this.instantiationService.createInstance(syncDescriptor); - const itemContainer = this.doCreateStatusItem(category, alignment, priority); + const itemContainer = this.doCreateStatusItem(id, name, alignment, priority); this._register(item.render(itemContainer)); this.element.appendChild(itemContainer); @@ -473,24 +477,27 @@ export class StatusbarPart extends Part implements IStatusbarService { const actions: Action[] = []; // Figure out if mouse is over an entry - let categoryUnderMouse: IStatusbarEntryCategory | undefined = undefined; + let statusEntryUnderMouse: string | undefined = undefined; for (let element: HTMLElement | null = event.target; element; element = element.parentElement) { - if (element.hasAttribute(StatusbarPart.CATEGORY_PROP)) { - categoryUnderMouse = { id: element.getAttribute(StatusbarPart.CATEGORY_PROP)!, label: element.title }; + if (element.hasAttribute(StatusbarPart.IDENTIFIER_PROP)) { + statusEntryUnderMouse = element.getAttribute(StatusbarPart.IDENTIFIER_PROP)!; break; } } - if (categoryUnderMouse) { - actions.push(new HideStatusCategoryAction(categoryUnderMouse, this.viewModel)); + if (statusEntryUnderMouse) { + actions.push(new HideStatusbarEntryAction(statusEntryUnderMouse, this.viewModel)); actions.push(new Separator()); } - // Show an entry per known status item category - const handledCategories = new Set(); + // Show an entry per known status item + // Note: even though entries have an identifier, there can be multiple entries + // having the same identifier (e.g. from extensions). So we make sure to only + // show a single entry per identifier we handled. + const handledEntries = new Set(); this.viewModel.items.forEach(item => { - if (!handledCategories.has(item.category.id)) { - actions.push(new ToggleStatusCategoryVisibilityAction(item.category, this.viewModel)); + if (!handledEntries.has(item.id)) { + actions.push(new ToggleStatusbarEntryVisibilityAction(item.id, item.name, this.viewModel)); } }); @@ -525,9 +532,9 @@ export class StatusbarPart extends Part implements IStatusbarService { this.styleElement.innerHTML = `.monaco-workbench .part.statusbar > .statusbar-item.has-beak:before { border-bottom-color: ${backgroundColor}; }`; } - private doCreateStatusItem(category: IStatusbarEntryCategory, alignment: StatusbarAlignment, priority: number = 0, ...extraClasses: string[]): HTMLElement { + private doCreateStatusItem(id: string, name: string, alignment: StatusbarAlignment, priority: number = 0, ...extraClasses: string[]): HTMLElement { const itemContainer = document.createElement('div'); - itemContainer.title = category.label; + itemContainer.title = name; addClass(itemContainer, 'statusbar-item'); if (extraClasses) { @@ -542,9 +549,9 @@ export class StatusbarPart extends Part implements IStatusbarService { itemContainer.setAttribute(StatusbarPart.PRIORITY_PROP, String(priority)); itemContainer.setAttribute(StatusbarPart.ALIGNMENT_PROP, String(alignment)); - itemContainer.setAttribute(StatusbarPart.CATEGORY_PROP, category.id); + itemContainer.setAttribute(StatusbarPart.IDENTIFIER_PROP, id); - if (this.viewModel.isHidden(category)) { + if (this.viewModel.isHidden(id)) { hide(itemContainer); } diff --git a/src/vs/workbench/contrib/debug/browser/debugStatus.ts b/src/vs/workbench/contrib/debug/browser/debugStatus.ts index 7c2af762d27..1ca7670ee0e 100644 --- a/src/vs/workbench/contrib/debug/browser/debugStatus.ts +++ b/src/vs/workbench/contrib/debug/browser/debugStatus.ts @@ -65,7 +65,8 @@ export class DebugStatusContribution implements IWorkbenchContribution { private get entry(): IStatusbarEntry { return { - category: { id: 'status.debug', label: nls.localize('status.debug', "Debug Configuration") }, + id: 'status.debug', + name: nls.localize('status.debug', "Debug Configuration"), text: this.getText(), tooltip: nls.localize('selectAndStartDebug', "Select and start debug configuration"), command: 'workbench.action.debug.selectandstart' diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts index 230ba879168..23fcbf5fe2b 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts @@ -84,7 +84,8 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio if (visible) { const indicator: IStatusbarEntry = { - category: { id: 'status.profiler', label: nls.localize('status.profiler', "Extension Profiler") }, + id: 'status.profiler', + name: nls.localize('status.profiler', "Extension Profiler"), text: nls.localize('profilingExtensionHost', "$(sync~spin) Profiling Extension Host"), tooltip: nls.localize('selectAndStartDebug', "Click to stop profiling."), command: 'workbench.action.extensionHostProfilder.stop' diff --git a/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts index 229612a51a3..efc8e2cb210 100644 --- a/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts +++ b/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts @@ -13,7 +13,8 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v // Register Statusbar item Registry.as(Extensions.Statusbar).registerStatusbarItem(new StatusbarItemDescriptor( FeedbackStatusbarItem, - { id: 'status.feedback', label: localize('status.feedback', "Send Feedback") }, + 'status.feedback', + localize('status.feedback', "Send Feedback"), StatusbarAlignment.RIGHT, -100 /* towards the end of the right hand side */ )); diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index dd1e7c4feee..c14aceed4cb 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -286,7 +286,8 @@ class MarkersStatusBarContributions extends Disposable implements IWorkbenchCont private getMarkersItem(): IStatusbarEntry { const markersStatistics = this.markerService.getStatistics(); return { - category: { id: 'status.problems', label: localize('status.problems', "Problems") }, + id: 'status.problems', + name: localize('status.problems', "Problems"), text: this.getMarkersText(markersStatistics), tooltip: this.getMarkersTooltip(markersStatistics), command: 'workbench.actions.view.toggleProblems' diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index a5d961a588a..1f7490e5430 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -138,7 +138,8 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc private renderWindowIndicator(text: string, tooltip?: string, command?: string): void { const properties: IStatusbarEntry = { - category: { id: 'status.host', label: nls.localize('status.host', "Remote Host") }, + id: 'status.host', + name: nls.localize('status.host', "Remote Host"), backgroundColor: themeColorFromId(STATUS_BAR_HOST_NAME_BACKGROUND), color: themeColorFromId(STATUS_BAR_HOST_NAME_FOREGROUND), text, tooltip, command }; if (this.windowIndicatorEntry) { diff --git a/src/vs/workbench/contrib/scm/browser/scmActivity.ts b/src/vs/workbench/contrib/scm/browser/scmActivity.ts index 1bbaca9b7b3..11e05b5104d 100644 --- a/src/vs/workbench/contrib/scm/browser/scmActivity.ts +++ b/src/vs/workbench/contrib/scm/browser/scmActivity.ts @@ -190,7 +190,8 @@ export class StatusBarController implements IWorkbenchContribution { const disposables = new DisposableStore(); for (const c of commands) { disposables.add(this.statusbarService.addEntry({ - category: { id: 'status.scm', label: localize('status.scm', "Source Control") }, + id: 'status.scm', + name: localize('status.scm', "Source Control"), text: c.title, tooltip: `${label} - ${c.tooltip}`, command: c.id, diff --git a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts index 1da64d3756a..c02649dfdf2 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts @@ -182,7 +182,8 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench } } else { const itemProps: IStatusbarEntry = { - category: { id: 'status.runningTasks', label: nls.localize('status.runningTasks', "Running Tasks") }, + id: 'status.runningTasks', + name: nls.localize('status.runningTasks', "Running Tasks"), text: `$(tools) ${tasks.length}`, tooltip: nls.localize('runningTasks', "Show Running Tasks"), command: 'workbench.action.tasks.showTasks', diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index 5385e10d7de..8bae20dde0f 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -129,7 +129,8 @@ export class ProgressService implements IProgressService { } this._globalStatusEntry = this._statusbarService.addEntry({ - category: { id: 'status.progress', label: localize('status.progress', "Progress Message") }, + id: 'status.progress', + name: localize('status.progress', "Progress Message"), text: `$(sync~spin) ${text}`, tooltip: title }, StatusbarAlignment.LEFT);