@@ -11,7 +11,7 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
11
11
import { localize } from 'vs/nls' ;
12
12
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
13
13
import { getIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge' ;
14
- import { getDefaultIgnoredSettings } from 'vs/platform/userDataSync/common/userDataSync' ;
14
+ import { getDefaultIgnoredSettings , IUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSync' ;
15
15
import { SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels' ;
16
16
17
17
const $ = DOM . $ ;
@@ -22,7 +22,7 @@ export interface ISettingOverrideClickEvent {
22
22
}
23
23
24
24
/**
25
- * Renders the indicators next to a setting, such as Sync Ignored, Also Modified In, etc .
25
+ * Renders the indicators next to a setting, such as " Also Modified In" .
26
26
*/
27
27
export class SettingsTreeIndicatorsLabel {
28
28
/**
@@ -34,7 +34,9 @@ export class SettingsTreeIndicatorsLabel {
34
34
private defaultOverrideIndicatorElement : HTMLElement ;
35
35
private defaultOverrideIndicatorLabel : SimpleIconLabel ;
36
36
37
- constructor ( container : HTMLElement ) {
37
+ constructor (
38
+ container : HTMLElement ,
39
+ @IUserDataSyncEnablementService private readonly userDataSyncEnablementService : IUserDataSyncEnablementService ) {
38
40
this . labelElement = DOM . append ( container , $ ( '.misc-label' ) ) ;
39
41
this . labelElement . style . display = 'inline' ;
40
42
@@ -53,7 +55,7 @@ export class SettingsTreeIndicatorsLabel {
53
55
private createSyncIgnoredElement ( ) : HTMLElement {
54
56
const syncIgnoredElement = $ ( 'span.setting-item-ignored' ) ;
55
57
const syncIgnoredLabel = new SimpleIconLabel ( syncIgnoredElement ) ;
56
- syncIgnoredLabel . text = `$(sync-ignored) ${ localize ( 'extensionSyncIgnoredLabel' , 'Sync: Ignored' ) } ` ;
58
+ syncIgnoredLabel . text = '$(info) ' + localize ( 'extensionSyncIgnoredLabel' , 'Setting not synced' ) ;
57
59
syncIgnoredLabel . title = localize ( 'syncIgnoredTitle' , "Settings sync does not sync this setting" ) ;
58
60
return syncIgnoredElement ;
59
61
}
@@ -76,15 +78,16 @@ export class SettingsTreeIndicatorsLabel {
76
78
DOM . append ( this . labelElement , $ ( 'span' , undefined , '(' ) ) ;
77
79
for ( let i = 0 ; i < elementsToShow . length - 1 ; i ++ ) {
78
80
DOM . append ( this . labelElement , elementsToShow [ i ] ) ;
79
- DOM . append ( this . labelElement , $ ( 'span.comma' , undefined , ', ' ) ) ;
81
+ DOM . append ( this . labelElement , $ ( 'span.comma' , undefined , ' • ' ) ) ;
80
82
}
81
83
DOM . append ( this . labelElement , elementsToShow [ elementsToShow . length - 1 ] ) ;
82
84
DOM . append ( this . labelElement , $ ( 'span' , undefined , ')' ) ) ;
83
85
}
84
86
}
85
87
86
88
updateSyncIgnored ( element : SettingsTreeSettingElement , ignoredSettings : string [ ] ) {
87
- this . syncIgnoredElement . style . display = ignoredSettings . includes ( element . setting . key ) ? 'inline' : 'none' ;
89
+ this . syncIgnoredElement . style . display = this . userDataSyncEnablementService . isEnabled ( )
90
+ && ignoredSettings . includes ( element . setting . key ) ? 'inline' : 'none' ;
88
91
this . render ( ) ;
89
92
}
90
93
@@ -133,7 +136,7 @@ export class SettingsTreeIndicatorsLabel {
133
136
}
134
137
if ( sourceToDisplay ) {
135
138
this . defaultOverrideIndicatorLabel . title = localize ( 'defaultOverriddenDetails' , "Default setting value overridden by {0}" , sourceToDisplay ) ;
136
- this . defaultOverrideIndicatorLabel . text = `$(replace) ${ sourceToDisplay } ` ;
139
+ this . defaultOverrideIndicatorLabel . text = '$(info) ' + localize ( 'defaultOverriddenLabel' , "Default value changed" ) ;
137
140
}
138
141
}
139
142
this . render ( ) ;
@@ -161,11 +164,14 @@ export function getIndicatorsLabelAriaLabel(element: SettingsTreeSettingElement,
161
164
// Add default override indicator text
162
165
if ( element . defaultValueSource ) {
163
166
const defaultValueSource = element . defaultValueSource ;
167
+ let sourceToDisplay = '' ;
164
168
if ( typeof defaultValueSource !== 'string' && defaultValueSource . id !== element . setting . extensionInfo ?. id ) {
165
- const extensionSource = defaultValueSource . displayName ?? defaultValueSource . id ;
166
- ariaLabelSections . push ( localize ( 'defaultOverriddenDetails' , "Default setting value overridden by {0}" , extensionSource ) ) ;
169
+ sourceToDisplay = defaultValueSource . displayName ?? defaultValueSource . id ;
167
170
} else if ( typeof defaultValueSource === 'string' ) {
168
- ariaLabelSections . push ( localize ( 'defaultOverriddenDetails' , "Default setting value overridden by {0}" , defaultValueSource ) ) ;
171
+ sourceToDisplay = defaultValueSource ;
172
+ }
173
+ if ( sourceToDisplay ) {
174
+ ariaLabelSections . push ( localize ( 'defaultOverriddenDetails' , "Default setting value overridden by {0}" , sourceToDisplay ) ) ;
169
175
}
170
176
}
171
177
0 commit comments