Skip to content

Commit 8d7f232

Browse files
authored
Fix Settings editor layout order (microsoft#146069)
* Fix microsoft#145572
1 parent c24d4a8 commit 8d7f232

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@
141141
margin-top: 14px;
142142
}
143143

144+
.settings-editor > .settings-body .settings-toc-container,
145+
.settings-editor > .settings-body .settings-tree-container {
146+
height: 100%;
147+
}
148+
144149
.settings-editor.no-results > .settings-body .settings-toc-container,
145150
.settings-editor.no-results > .settings-body .settings-tree-container {
146151
display: none;

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export class SettingsEditor2 extends EditorPane {
411411
return;
412412
}
413413

414-
this.layoutTrees(dimension);
414+
this.layoutSplitView(dimension);
415415

416416
const innerWidth = Math.min(1000, dimension.width) - 24 * 2; // 24px padding on left and right;
417417
// minus padding inside inputbox, countElement width, controls width, extra padding before countElement
@@ -714,6 +714,7 @@ export class SettingsEditor2 extends EditorPane {
714714
maximumSize: Number.POSITIVE_INFINITY,
715715
layout: (width) => {
716716
this.tocTreeContainer.style.width = `${width}px`;
717+
this.tocTree.layout(undefined, width);
717718
}
718719
}, startingWidth, undefined, true);
719720
this.splitView.addView({
@@ -723,6 +724,7 @@ export class SettingsEditor2 extends EditorPane {
723724
maximumSize: Number.POSITIVE_INFINITY,
724725
layout: (width) => {
725726
this.settingsTreeContainer.style.width = `${width}px`;
727+
this.settingsTree.layout(undefined, width);
726728
}
727729
}, Sizing.Distribute, undefined, true);
728730
this._register(this.splitView.onDidSashReset(() => {
@@ -1534,17 +1536,10 @@ export class SettingsEditor2 extends EditorPane {
15341536
});
15351537
}
15361538

1537-
private layoutTrees(dimension: DOM.Dimension): void {
1539+
private layoutSplitView(dimension: DOM.Dimension): void {
15381540
const listHeight = dimension.height - (72 + 11 + 14 /* header height + editor padding */);
1539-
const settingsTreeHeight = listHeight;
1540-
this.settingsTreeContainer.style.height = `${settingsTreeHeight}px`;
1541-
this.settingsTree.layout(settingsTreeHeight, dimension.width);
15421541

1543-
const tocTreeHeight = settingsTreeHeight;
1544-
this.tocTreeContainer.style.height = `${tocTreeHeight}px`;
1545-
this.tocTree.layout(tocTreeHeight);
1546-
1547-
this.splitView.el.style.height = `${settingsTreeHeight}px`;
1542+
this.splitView.el.style.height = `${listHeight}px`;
15481543

15491544
// We call layout first so the splitView has an idea of how much
15501545
// space it has, otherwise setViewVisible results in the first panel

0 commit comments

Comments
 (0)