提交 b6a40fd7 编写于 作者: B Benjamin Pasero

web - remove deprecated command property for home indicator

上级 3db1eb51
......@@ -26,7 +26,6 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { Codicon } from 'vs/base/common/codicons';
import { ActionViewItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { isMacintosh } from 'vs/base/common/platform';
......@@ -370,25 +369,6 @@ export class HomeActionViewItem extends ActionViewItem {
}
}
/**
* @deprecated TODO@ben remove me eventually
*/
export class DeprecatedHomeAction extends Action {
constructor(
private readonly command: string,
name: string,
icon: Codicon,
@ICommandService private readonly commandService: ICommandService
) {
super('workbench.action.home', name, icon.classNames);
}
async run(): Promise<void> {
this.commandService.executeCommand(this.command);
}
}
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
const activityBarBackgroundColor = theme.getColor(ACTIVITY_BAR_BACKGROUND);
if (activityBarBackgroundColor) {
......
......@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { GLOBAL_ACTIVITY_ID, IActivity, ACCOUNTS_ACTIIVTY_ID } from 'vs/workbench/common/activity';
import { Part } from 'vs/workbench/browser/part';
import { GlobalActivityActionViewItem, ViewContainerActivityAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewContainerActivityAction, AccountsActionViewItem, HomeAction, HomeActionViewItem, DeprecatedHomeAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { GlobalActivityActionViewItem, ViewContainerActivityAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewContainerActivityAction, AccountsActionViewItem, HomeAction, HomeActionViewItem } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IBadge, NumberBadge } from 'vs/workbench/services/activity/common/activity';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
......@@ -400,7 +400,8 @@ export class ActivitybarPart extends Part implements IActivityBarService {
console.warn(`Unknown home indicator icon ${homeIndicator.icon}`);
codicon = Codicon.code;
}
this.createHomeBar(homeIndicator.href, homeIndicator.command, homeIndicator.title, codicon);
this.createHomeBar(homeIndicator.href, homeIndicator.title, codicon);
this.onDidChangeHomeBarVisibility();
}
......@@ -422,7 +423,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
return this.content;
}
private createHomeBar(href: string, command: string | undefined, title: string, icon: Codicon): void {
private createHomeBar(href: string, title: string, icon: Codicon): void {
this.homeBarContainer = document.createElement('div');
this.homeBarContainer.setAttribute('aria-label', nls.localize('homeIndicator', "Home"));
this.homeBarContainer.setAttribute('role', 'toolbar');
......@@ -432,19 +433,14 @@ export class ActivitybarPart extends Part implements IActivityBarService {
orientation: ActionsOrientation.VERTICAL,
animated: false,
ariaLabel: nls.localize('home', "Home"),
actionViewItemProvider: command ? undefined : action => new HomeActionViewItem(action),
actionViewItemProvider: action => new HomeActionViewItem(action),
allowContextMenu: true
}));
const homeBarIconBadge = document.createElement('div');
addClass(homeBarIconBadge, 'home-bar-icon-badge');
this.homeBarContainer.appendChild(homeBarIconBadge);
if (command) {
this.homeBar.push(this._register(this.instantiationService.createInstance(DeprecatedHomeAction, command, title, icon)), { icon: true, label: false });
} else {
this.homeBar.push(this._register(this.instantiationService.createInstance(HomeAction, href, title, icon)));
}
this.homeBar.push(this._register(this.instantiationService.createInstance(HomeAction, href, title, icon)));
const content = assertIsDefined(this.content);
content.prepend(this.homeBarContainer);
......
......@@ -106,11 +106,6 @@ interface IHomeIndicator {
*/
href: string;
/**
* @deprecated use `href` instead.
*/
command?: string;
/**
* The icon name for the home indicator. This needs to be one of the existing
* icons from our Codicon icon set. For example `sync`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册