@@ -14,7 +14,7 @@ import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/bro
14
14
import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
15
15
import { IDisposable , toDisposable , DisposableStore , Disposable } from 'vs/base/common/lifecycle' ;
16
16
import { ToggleActivityBarVisibilityAction , ToggleMenuBarAction , ToggleSidebarPositionAction } from 'vs/workbench/browser/actions/layoutActions' ;
17
- import { IThemeService , IColorTheme } from 'vs/platform/theme/common/themeService' ;
17
+ import { IThemeService , IColorTheme , ThemeIcon } from 'vs/platform/theme/common/themeService' ;
18
18
import { ACTIVITY_BAR_BACKGROUND , ACTIVITY_BAR_BORDER , ACTIVITY_BAR_FOREGROUND , ACTIVITY_BAR_ACTIVE_BORDER , ACTIVITY_BAR_BADGE_BACKGROUND , ACTIVITY_BAR_BADGE_FOREGROUND , ACTIVITY_BAR_INACTIVE_FOREGROUND , ACTIVITY_BAR_ACTIVE_BACKGROUND , ACTIVITY_BAR_DRAG_AND_DROP_BORDER } from 'vs/workbench/common/theme' ;
19
19
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry' ;
20
20
import { CompositeBar , ICompositeBarItem , CompositeDragAndDrop } from 'vs/workbench/browser/parts/compositeBar' ;
@@ -25,7 +25,7 @@ import { URI, UriComponents } from 'vs/base/common/uri';
25
25
import { ToggleCompositePinnedAction , ICompositeBarColors , ActivityAction , ICompositeActivity } from 'vs/workbench/browser/parts/compositeBarActions' ;
26
26
import { IViewDescriptorService , ViewContainer , TEST_VIEW_CONTAINER_ID , IViewContainerModel , ViewContainerLocation , IViewsService } from 'vs/workbench/common/views' ;
27
27
import { IContextKeyService , ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
28
- import { isUndefinedOrNull , assertIsDefined , isString } from 'vs/base/common/types' ;
28
+ import { isUndefinedOrNull , assertIsDefined } from 'vs/base/common/types' ;
29
29
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService' ;
30
30
import { registerSingleton } from 'vs/platform/instantiation/common/extensions' ;
31
31
import { Schemas } from 'vs/base/common/network' ;
@@ -47,7 +47,7 @@ interface IPlaceholderViewContainer {
47
47
id : string ;
48
48
name ?: string ;
49
49
iconUrl ?: UriComponents ;
50
- iconCSS ?: string ;
50
+ themeIcon ?: ThemeIcon ;
51
51
views ?: { when ?: string } [ ] ;
52
52
}
53
53
@@ -61,7 +61,7 @@ interface IPinnedViewContainer {
61
61
interface ICachedViewContainer {
62
62
id : string ;
63
63
name ?: string ;
64
- icon ?: URI | string ;
64
+ icon ?: URI | ThemeIcon ;
65
65
pinned : boolean ;
66
66
order ?: number ;
67
67
visible : boolean ;
@@ -717,7 +717,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
717
717
return ActivitybarPart . toActivity ( id , name , icon , focusCommand ?. id || id ) ;
718
718
}
719
719
720
- private static toActivity ( id : string , name : string , icon : URI | string | undefined , keybindingId : string | undefined ) : IActivity {
720
+ private static toActivity ( id : string , name : string , icon : URI | ThemeIcon | undefined , keybindingId : string | undefined ) : IActivity {
721
721
let cssClass : string | undefined = undefined ;
722
722
let iconUrl : URI | undefined = undefined ;
723
723
if ( URI . isUri ( icon ) ) {
@@ -730,8 +730,8 @@ export class ActivitybarPart extends Part implements IActivityBarService {
730
730
-webkit-mask: ${ asCSSUrl ( icon ) } no-repeat 50% 50%;
731
731
-webkit-mask-size: 24px;
732
732
` ) ;
733
- } else if ( isString ( icon ) ) {
734
- cssClass = icon ;
733
+ } else if ( ThemeIcon . isThemeIcon ( icon ) ) {
734
+ cssClass = ThemeIcon . asClassName ( icon ) ;
735
735
}
736
736
return { id, name, cssClass, iconUrl, keybindingId } ;
737
737
}
@@ -911,7 +911,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
911
911
const cachedViewContainer = this . _cachedViewContainers . filter ( cached => cached . id === placeholderViewContainer . id ) [ 0 ] ;
912
912
if ( cachedViewContainer ) {
913
913
cachedViewContainer . name = placeholderViewContainer . name ;
914
- cachedViewContainer . icon = placeholderViewContainer . iconCSS ? placeholderViewContainer . iconCSS :
914
+ cachedViewContainer . icon = placeholderViewContainer . themeIcon ? ThemeIcon . revive ( placeholderViewContainer . themeIcon ) :
915
915
placeholderViewContainer . iconUrl ? URI . revive ( placeholderViewContainer . iconUrl ) : undefined ;
916
916
cachedViewContainer . views = placeholderViewContainer . views ;
917
917
}
@@ -930,7 +930,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
930
930
this . setPlaceholderViewContainers ( cachedViewContainers . map ( ( { id, icon, name, views } ) => ( < IPlaceholderViewContainer > {
931
931
id,
932
932
iconUrl : URI . isUri ( icon ) ? icon : undefined ,
933
- iconCSS : isString ( icon ) ? icon : undefined ,
933
+ themeIcon : ThemeIcon . isThemeIcon ( icon ) ? icon : undefined ,
934
934
name,
935
935
views
936
936
} ) ) ) ;
0 commit comments