make the tree theme aware and remove group color (#13143)

* make the tree theme aware and remove group color

* fix eslint error
This commit is contained in:
Alan Ren
2020-10-29 22:46:11 -07:00
committed by GitHub
parent 7857e8aeb9
commit ac476ba973
3 changed files with 18 additions and 8 deletions

View File

@@ -134,7 +134,7 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
new ProviderElementRenderer(),
this.instantiationService.createInstance(TreeItemRenderer, this.treeLabels),
this.instantiationService.createInstance(ConnectionProfileRenderer, true),
this.instantiationService.createInstance(ConnectionProfileGroupRenderer),
this.instantiationService.createInstance(ConnectionProfileGroupRenderer, { showColor: false }),
this.instantiationService.createInstance(TreeNodeRenderer),
new SavedConnectionsNodeRenderer()
];
@@ -215,6 +215,10 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
this._register(this.capabilitiesService.onCapabilitiesRegistered(() => {
this.updateSavedConnectionsNode();
}));
this._register(this.themeService.onDidColorThemeChange(async () => {
await this.refresh();
}));
}
private updateSavedConnectionsNode(): void {
@@ -411,7 +415,7 @@ class DataSource implements IAsyncDataSource<TreeModel, TreeElement> {
} else if (element instanceof ConnectionProfile) {
return false;
} else if (element instanceof ConnectionProfileGroup) {
return element.hasChildren();
return true;
} else if (element instanceof TreeNode) {
return element.children.length > 0;
} else if (element instanceof SavedConnectionNode) {