3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
+ import { Codicon } from 'vs/base/common/codicons' ;
6
7
import { Event } from 'vs/base/common/event' ;
7
8
import { Disposable , DisposableStore , IDisposable , MutableDisposable } from 'vs/base/common/lifecycle' ;
8
9
import { ServicesAccessor } from 'vs/editor/browser/editorExtensions' ;
9
10
import { localize } from 'vs/nls' ;
10
11
import { Action2 , ISubmenuItem , MenuId , MenuRegistry , registerAction2 } from 'vs/platform/actions/common/actions' ;
11
12
import { ContextKeyExpr , IContextKey , IContextKeyService , RawContextKey } from 'vs/platform/contextkey/common/contextkey' ;
13
+ import { registerColor } from 'vs/platform/theme/common/colorRegistry' ;
14
+ import { themeColorFromId } from 'vs/platform/theme/common/themeService' ;
12
15
import { IUserDataProfile , IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' ;
13
16
import { IWorkspaceContextService , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
14
17
import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys' ;
15
18
import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
16
- import { IStatusbarEntryAccessor , IStatusbarService , StatusbarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar' ;
19
+ import { IStatusbarEntry , IStatusbarEntryAccessor , IStatusbarService , StatusbarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar' ;
17
20
import { IUserDataProfileManagementService , IUserDataProfileService , ManageProfilesSubMenu , PROFILES_CATEGORY , PROFILES_ENABLEMENT_CONTEXT , PROFILES_TTILE } from 'vs/workbench/services/userDataProfile/common/userDataProfile' ;
18
21
19
22
const CONTEXT_CURRENT_PROFILE = new RawContextKey < string > ( 'currentUserDataProfile' , '' ) ;
@@ -109,17 +112,20 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
109
112
110
113
private profileStatusAccessor : IStatusbarEntryAccessor | undefined ;
111
114
private updateStatus ( ) : void {
112
- if ( this . userDataProfilesService . profiles . length > 1 && this . workspaceContextService . getWorkbenchState ( ) !== WorkbenchState . EMPTY ) {
113
- const statusBarEntry = {
114
- name : this . userDataProfileService . currentProfile . name ! ,
115
+ if ( this . userDataProfilesService . profiles . length && this . workspaceContextService . getWorkbenchState ( ) !== WorkbenchState . EMPTY ) {
116
+ const statusBarEntry : IStatusbarEntry = {
117
+ name : PROFILES_CATEGORY ,
115
118
command : 'workbench.profiles.actions.switchProfile' ,
116
119
ariaLabel : localize ( 'currentProfile' , "Current Settings Profile is {0}" , this . userDataProfileService . currentProfile . name ) ,
117
- text : `${ PROFILES_CATEGORY } : ${ this . userDataProfileService . currentProfile . name ! } ` ,
120
+ text : `$(${ Codicon . multipleWindows . id } ) ${ this . userDataProfileService . currentProfile . name ! } ` ,
121
+ tooltip : localize ( 'profileTooltip' , "{0}: {1}" , PROFILES_CATEGORY , this . userDataProfileService . currentProfile . name ) ,
122
+ color : themeColorFromId ( STATUS_BAR_SETTINGS_PROFILE_FOREGROUND ) ,
123
+ backgroundColor : themeColorFromId ( STATUS_BAR_SETTINGS_PROFILE_BACKGROUND )
118
124
} ;
119
125
if ( this . profileStatusAccessor ) {
120
126
this . profileStatusAccessor . update ( statusBarEntry ) ;
121
127
} else {
122
- this . profileStatusAccessor = this . statusBarService . addEntry ( statusBarEntry , 'status.userDataProfile' , StatusbarAlignment . LEFT , 1 ) ;
128
+ this . profileStatusAccessor = this . statusBarService . addEntry ( statusBarEntry , 'status.userDataProfile' , StatusbarAlignment . LEFT , Number . MAX_VALUE - 1 ) ;
123
129
}
124
130
} else {
125
131
if ( this . profileStatusAccessor ) {
@@ -129,3 +135,17 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
129
135
}
130
136
}
131
137
}
138
+
139
+ const STATUS_BAR_SETTINGS_PROFILE_FOREGROUND = registerColor ( 'statusBarItem.settingsProfilesForeground' , {
140
+ dark : null ,
141
+ light : null ,
142
+ hcDark : null ,
143
+ hcLight : null
144
+ } , localize ( 'statusBarItemSettingsProfileForeground' , "Foreground color for the settings profile entry on the status bar." ) ) ;
145
+
146
+ const STATUS_BAR_SETTINGS_PROFILE_BACKGROUND = registerColor ( 'statusBarItem.settingsProfilesBackground' , {
147
+ dark : null ,
148
+ light : null ,
149
+ hcDark : null ,
150
+ hcLight : null
151
+ } , localize ( 'statusBarItemSettingsProfileBackground' , "Background color for the settings profile entry on the status bar." ) ) ;
0 commit comments