@@ -839,6 +839,11 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async
839839 this . internals = new WorkbenchTreeInternals ( this , treeOptions , getAutomaticKeyboardNavigation , options . overrideStyles , contextKeyService , listService , themeService , configurationService , accessibilityService ) ;
840840 this . disposables . add ( this . internals ) ;
841841 }
842+
843+ updateOptions ( options : IWorkbenchAsyncDataTreeOptions < T , TFilterData > = { } ) : void {
844+ super . updateOptions ( options ) ;
845+ this . internals . updateStyleOverrides ( options . overrideStyles ) ;
846+ }
842847}
843848
844849export interface IWorkbenchCompressibleAsyncDataTreeOptions < T , TFilterData > extends ICompressibleAsyncDataTreeOptions < T , TFilterData > {
@@ -936,15 +941,16 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
936941 private hasMultiSelection : IContextKey < boolean > ;
937942 private _useAltAsMultipleSelectionModifier : boolean ;
938943 private disposables : IDisposable [ ] = [ ] ;
944+ private styler ! : IDisposable ;
939945
940946 constructor (
941- tree : WorkbenchObjectTree < T , TFilterData > | CompressibleObjectTree < T , TFilterData > | WorkbenchDataTree < TInput , T , TFilterData > | WorkbenchAsyncDataTree < TInput , T , TFilterData > | WorkbenchCompressibleAsyncDataTree < TInput , T , TFilterData > ,
947+ private tree : WorkbenchObjectTree < T , TFilterData > | CompressibleObjectTree < T , TFilterData > | WorkbenchDataTree < TInput , T , TFilterData > | WorkbenchAsyncDataTree < TInput , T , TFilterData > | WorkbenchCompressibleAsyncDataTree < TInput , T , TFilterData > ,
942948 options : IAbstractTreeOptions < T , TFilterData > | IAsyncDataTreeOptions < T , TFilterData > ,
943949 getAutomaticKeyboardNavigation : ( ) => boolean | undefined ,
944950 overrideStyles : IColorMapping | undefined ,
945951 @IContextKeyService contextKeyService : IContextKeyService ,
946952 @IListService listService : IListService ,
947- @IThemeService themeService : IThemeService ,
953+ @IThemeService private themeService : IThemeService ,
948954 @IConfigurationService configurationService : IConfigurationService ,
949955 @IAccessibilityService accessibilityService : IAccessibilityService ,
950956 ) {
@@ -970,10 +976,11 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
970976 } ) ;
971977 } ;
972978
979+ this . updateStyleOverrides ( overrideStyles ) ;
980+
973981 this . disposables . push (
974982 this . contextKeyService ,
975983 ( listService as ListService ) . register ( tree ) ,
976- overrideStyles ? attachListStyler ( tree , themeService , overrideStyles ) : Disposable . None ,
977984 tree . onDidChangeSelection ( ( ) => {
978985 const selection = tree . getSelection ( ) ;
979986 const focus = tree . getFocus ( ) ;
@@ -1023,8 +1030,14 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
10231030 return this . _useAltAsMultipleSelectionModifier ;
10241031 }
10251032
1033+ updateStyleOverrides ( overrideStyles ?: IColorMapping ) : void {
1034+ dispose ( this . styler ) ;
1035+ this . styler = overrideStyles ? attachListStyler ( this . tree , this . themeService , overrideStyles ) : Disposable . None ;
1036+ }
1037+
10261038 dispose ( ) : void {
10271039 this . disposables = dispose ( this . disposables ) ;
1040+ this . styler = dispose ( this . styler ) ;
10281041 }
10291042}
10301043
0 commit comments