Skip to content

Commit 3f4b564

Browse files
committed
centered view layout: boundary sashes
1 parent 77d5746 commit 3f4b564

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/vs/base/browser/ui/centered/centeredViewLayout.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Event } from 'vs/base/common/event';
99
import { IView, IViewSize } from 'vs/base/browser/ui/grid/grid';
1010
import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
1111
import { Color } from 'vs/base/common/color';
12+
import { IBoundarySashes } from 'vs/base/browser/ui/grid/gridview';
1213

1314
export interface CenteredViewState {
1415
leftMarginRatio: number;
@@ -72,6 +73,19 @@ export class CenteredViewLayout implements IDisposable {
7273
get maximumHeight(): number { return this.view.maximumHeight; }
7374
get onDidChange(): Event<IViewSize | undefined> { return this.view.onDidChange; }
7475

76+
private _boundarySashes: IBoundarySashes = {};
77+
get boundarySashes(): IBoundarySashes { return this._boundarySashes; }
78+
set boundarySashes(boundarySashes: IBoundarySashes) {
79+
this._boundarySashes = boundarySashes;
80+
81+
if (!this.splitView) {
82+
return;
83+
}
84+
85+
this.splitView.orthogonalStartSash = boundarySashes.top;
86+
this.splitView.orthogonalEndSash = boundarySashes.bottom;
87+
}
88+
7589
layout(width: number, height: number): void {
7690
this.width = width;
7791
this.height = height;
@@ -119,6 +133,8 @@ export class CenteredViewLayout implements IDisposable {
119133
orientation: Orientation.HORIZONTAL,
120134
styles: this.style
121135
});
136+
this.splitView.orthogonalStartSash = this.boundarySashes.top;
137+
this.splitView.orthogonalEndSash = this.boundarySashes.bottom;
122138

123139
this.splitViewDisposables.add(this.splitView.onDidSashChange(() => {
124140
if (this.splitView) {

src/vs/workbench/browser/parts/editor/editorPart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
979979

980980
setBoundarySashes(sashes: IBoundarySashes): void {
981981
this.gridWidget.boundarySashes = sashes;
982+
this.centeredLayoutWidget.boundarySashes = sashes;
982983
}
983984

984985
layout(width: number, height: number): void {

0 commit comments

Comments
 (0)