Skip to content

Commit fe64656

Browse files
committed
doing the same for outline
1 parent d9e4100 commit fe64656

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/vs/platform/list/browser/listService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,11 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T
807807
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
808808
this.disposables.add(this.internals);
809809
}
810+
811+
updateOptions(options: IWorkbenchAsyncDataTreeOptions<T, TFilterData> = {}): void {
812+
super.updateOptions(options);
813+
this.internals.updateStyleOverrides(options.overrideStyles);
814+
}
810815
}
811816

812817
export interface IWorkbenchAsyncDataTreeOptions<T, TFilterData> extends IAsyncDataTreeOptions<T, TFilterData> {

src/vs/workbench/browser/parts/views/viewPaneContainer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export abstract class ViewPane extends Pane implements IView {
9191
@IContextMenuService protected contextMenuService: IContextMenuService,
9292
@IConfigurationService protected readonly configurationService: IConfigurationService,
9393
@IContextKeyService contextKeyService: IContextKeyService,
94-
@IViewDescriptorService private viewDescriptorService: IViewDescriptorService,
94+
@IViewDescriptorService protected viewDescriptorService: IViewDescriptorService,
9595
@IInstantiationService protected instantiationService: IInstantiationService,
9696
) {
9797
super(options);

src/vs/workbench/contrib/outline/browser/outlinePane.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import { basename } from 'vs/base/common/resources';
4747
import { IDataSource } from 'vs/base/browser/ui/tree/tree';
4848
import { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService';
4949
import { MarkerSeverity } from 'vs/platform/markers/common/markers';
50-
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
5150
import { IViewDescriptorService } from 'vs/workbench/common/views';
5251

5352
class RequestState {
@@ -335,13 +334,19 @@ export class OutlinePane extends ViewPane {
335334
keyboardNavigationLabelProvider: new OutlineNavigationLabelProvider(),
336335
hideTwistiesOfChildlessElements: true,
337336
overrideStyles: {
338-
listBackground: SIDE_BAR_BACKGROUND
337+
listBackground: this.getBackgroundColor()
339338
}
340339
}
341340
);
342341

342+
343343
this._disposables.push(this._tree);
344344
this._disposables.push(this._outlineViewState.onDidChange(this._onDidChangeUserState, this));
345+
this._disposables.push(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
346+
if (views.some(v => v.id === this.id)) {
347+
this._tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
348+
}
349+
}));
345350

346351
// override the globally defined behaviour
347352
this._tree.updateOptions({

0 commit comments

Comments
 (0)