提交 d66d3dd7 编写于 作者: R Rob Lourens

Fix #52809 - add setting to hide TOC entirely

上级 b577cceb
......@@ -310,8 +310,13 @@ configurationRegistry.registerConfiguration({
'workbench.settings.settingsSearchTocBehavior': {
'type': 'string',
'enum': ['hide', 'filter', 'show'],
'description': nls.localize('settingsSearchTocBehavior', "Controls the behavior of the settings editor TOC while searching."),
'description': nls.localize('settingsSearchTocBehavior', "Controls the behavior of the settings editor Table of Contents while searching."),
'default': 'hide'
},
'workbench.settings.tocVisible': {
'type': 'boolean',
'description': nls.localize('settingsTocVisible', "Controls whether the settings editor Table of Contents is visible."),
'default': true
}
}
});
......
......@@ -111,10 +111,11 @@
.settings-editor > .settings-body .settings-toc-container {
width: 175px;
margin-right: 5px;
padding-top: 5px;
}
.settings-editor > .settings-body .settings-toc-container {
padding-top: 5px;
.settings-editor > .settings-body .settings-toc-container.hidden {
display: none;
}
.search-mode .settings-toc-container {
......
......@@ -99,7 +99,13 @@ export class SettingsEditor2 extends BaseEditor {
this.inSettingsEditorContextKey = CONTEXT_SETTINGS_EDITOR.bindTo(contextKeyService);
this.searchFocusContextKey = CONTEXT_SETTINGS_SEARCH_FOCUS.bindTo(contextKeyService);
this._register(configurationService.onDidChangeConfiguration(() => this.onConfigUpdate()));
this._register(configurationService.onDidChangeConfiguration(e => {
this.onConfigUpdate();
if (e.affectsConfiguration('workbench.settings.tocVisible')) {
this.updateTOCVisible();
}
}));
}
createEditor(parent: HTMLElement): void {
......@@ -259,6 +265,13 @@ export class SettingsEditor2 extends BaseEditor {
}
}
}));
this.updateTOCVisible();
}
private updateTOCVisible(): void {
const visible = !!this.configurationService.getValue('workbench.settings.tocVisible');
DOM.toggleClass(this.tocTreeContainer, 'hidden', !visible);
}
private createSettingsTree(parent: HTMLElement): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册