提交 61e0cf06 编写于 作者: B Benjamin Pasero

Restore "snap to minimize/maximize" feature with grid editor layout (fixes #51614)

上级 d17ceea0
......@@ -279,10 +279,15 @@ export class Grid<T extends IView> implements IDisposable {
getViewSize(view: T): number {
const location = this.getViewLocation(view);
const viewSize = this.gridview.getViewSize(location);
return getLocationOrientation(this.orientation, location) === Orientation.HORIZONTAL ? viewSize.width : viewSize.height;
}
// TODO@joao cleanup
getViewSize2(view: T): { width: number; height: number; } {
const location = this.getViewLocation(view);
return this.gridview.getViewSize(location);
}
maximizeViewSize(view: T): void {
const location = this.getViewLocation(view);
this.gridview.maximizeViewSize(location);
......
......@@ -544,6 +544,14 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
// Mark group as new active
group.setActive(true);
// Maximize the group if it is currently minimized
if (this.gridWidget) {
const viewSize = this.gridWidget.getViewSize2(group);
if (viewSize.width === group.minimumWidth || viewSize.height === group.minimumHeight) {
this.arrangeGroups(GroupsArrangement.MINIMIZE_OTHERS);
}
}
// Event
this._onDidActiveGroupChange.fire(group);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册