提交 1cdbe70c 编写于 作者: P Pine Wu

Make activity bar icon class unique

上级 b205a4c5
......@@ -16,7 +16,7 @@ import { ITreeExplorerViewletService, TreeExplorerViewletService } from 'vs/work
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet';
import { ITreeExplorer } from 'vs/platform/extensionManagement/common/extensionManagement';
import { toCustomViewletId } from 'vs/workbench/parts/explorers/common/treeExplorer';
import { toCustomViewletId, toCustomViewletCSSClass } from 'vs/workbench/parts/explorers/common/treeExplorer';
registerSingleton(ITreeExplorerViewletService, TreeExplorerViewletService);
......@@ -45,7 +45,7 @@ ExtensionsRegistry.registerExtensionPoint<ITreeExplorer>('explorer', [], explore
const getIconRule = (iconPath) => { return `background-image: url('${iconPath}')`; };
if (icon) {
const iconClass = `.monaco-workbench > .activitybar .monaco-action-bar .action-label.${treeExplorerNodeProviderId}`;
const iconClass = `.monaco-workbench > .activitybar .monaco-action-bar .action-label.${toCustomViewletCSSClass(treeExplorerNodeProviderId)}`;
const iconPath = join(extension.description.extensionFolderPath, icon);
createCSSRule(iconClass, getIconRule(iconPath));
}
......@@ -55,7 +55,7 @@ ExtensionsRegistry.registerExtensionPoint<ITreeExplorer>('explorer', [], explore
'TreeExplorerViewlet',
toCustomViewletId(treeExplorerNodeProviderId),
treeLabel,
treeExplorerNodeProviderId,
toCustomViewletCSSClass(treeExplorerNodeProviderId),
-1, // Extension viewlets are ordered by enabling sequence, so order here doesn't matter.
true
));
......
......@@ -4,13 +4,14 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
const CUSTOM_VIEWLET_ID_ROOT = 'workbench.view.customExplorer.';
const CUSTOM_VIEWLET_ACTION_ID_ROOT = 'workbench.action.customExplorer.';
export function toCustomViewletId(viewletId: string): string {
return CUSTOM_VIEWLET_ID_ROOT + viewletId;
return 'workbench.view.customExplorer.' + viewletId;
}
export function toCustomViewletActionId(viewletId: string): string {
return CUSTOM_VIEWLET_ACTION_ID_ROOT + viewletId;
return 'workbench.action.customExplorer.' + viewletId;
}
export function toCustomViewletCSSClass(viewletId: string): string {
return 'customExplorer-' + viewletId;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册