提交 b257ca20 编写于 作者: J Joao Moreno

grid: views should know which orientation they are laid out

上级 7ff3173b
......@@ -40,7 +40,7 @@ function toSplitViewView(view: IView, getHeight: () => number): ISplitViewView {
get maximumSize() { return view.maximumWidth; },
get minimumSize() { return view.minimumWidth; },
onDidChange: Event.map(view.onDidChange, e => e && e.width),
layout: size => view.layout(size, getHeight())
layout: size => view.layout(size, getHeight(), Orientation.HORIZONTAL)
};
}
......@@ -78,7 +78,7 @@ export class CenteredViewLayout {
this.resizeMargins();
}
} else {
this.view.layout(width, height);
this.view.layout(width, height, Orientation.HORIZONTAL);
}
this.didLayout = true;
}
......
......@@ -24,7 +24,7 @@ export interface IView {
readonly onDidChange: Event<{ width: number; height: number; } | undefined>;
readonly priority?: LayoutPriority;
readonly snapSize?: number;
layout(width: number, height: number): void;
layout(width: number, height: number, orientation: Orientation): void;
}
export function orthogonal(orientation: Orientation): Orientation {
......@@ -480,12 +480,12 @@ class LeafNode implements ISplitView, IDisposable {
layout(size: number): void {
this._size = size;
return this.view.layout(this.width, this.height);
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
}
orthogonalLayout(size: number): void {
this._orthogonalSize = size;
return this.view.layout(this.width, this.height);
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
}
dispose(): void { }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册