提交 68bac685 编写于 作者: B Benjamin Pasero

grid - some feedback wip

上级 239c0452
......@@ -35,6 +35,8 @@ export class NextEditorGroupView extends Themable implements IView {
private group: EditorGroup;
private dimension: Dimension;
private _element: HTMLElement;
private container: HTMLElement;
......@@ -52,6 +54,14 @@ export class NextEditorGroupView extends Themable implements IView {
this.group.label = `Group <${this.group.id}>`;
}
get id(): GroupIdentifier {
return this.group.id;
}
get element(): HTMLElement {
return this._element;
}
openEditor(input: EditorInput, options?: EditorOptions): INextEditor {
// Update model
......@@ -66,13 +76,7 @@ export class NextEditorGroupView extends Themable implements IView {
return Object.create(null); // TODO@grid implement
}
get element(): HTMLElement {
return this._element;
}
get id(): GroupIdentifier {
return this.group.id;
}
//#region Themable Implementation
protected updateStyles(): void {
super.updateStyles();
......@@ -92,6 +96,10 @@ export class NextEditorGroupView extends Themable implements IView {
// TODO@grid Editor container border
}
//#endregion
//#region IView implementation
render(container: HTMLElement): void {
// TODO@grid simplify containers by flattening the hierarchy more?
......@@ -138,9 +146,14 @@ export class NextEditorGroupView extends Themable implements IView {
this.updateStyles();
}
layout(size: number, orientation: Orientation): void {
layout(size: number): void {
this.dimension = new Dimension(size, -1); // TODO@grid need full dimension here
// Layout title
// this.titleAreaControl.layout(new Dimension(size, NextEditorGroupView.EDITOR_TITLE_HEIGHT));
// Layout title if present
if (this.titleAreaControl) {
this.titleAreaControl.layout(new Dimension(this.dimension.width, NextEditorGroupView.EDITOR_TITLE_HEIGHT));
}
}
//#endregion
}
\ No newline at end of file
......@@ -45,7 +45,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
this._onLayout = this._register(new Emitter<Dimension>());
this.createGrid();
this.doCreateGridView();
}
//#region Service Implementation
......@@ -62,6 +62,17 @@ export class NextEditorPart extends Part implements INextEditorPartService {
return this._groups.get(identifier);
}
// addGroup(index?: number): INextEditorGroup {
// const activeLocation = this.groupToLocation.get(this._activeGroup.id);
// const parentLocation = activeLocation.slice(0, activeLocation.length - 1);
// if (typeof index !== 'number') {
// index = activeLocation[activeLocation.length - 1] + 1;
// }
// return this.doCreateGroup([...parentLocation, index]);
// }
//#endregion
//#region Grid Controller
......@@ -97,7 +108,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
return this._onLayout.event;
}
private createGrid(): void {
private doCreateGridView(): void {
// Container
this.gridContainer = document.createElement('div');
......
......@@ -40,5 +40,7 @@ export interface INextEditorPartService {
readonly activeGroup: INextEditorGroup;
readonly groups: INextEditorGroup[];
// addGroup(group: GroupIdentifier, direction: SplitDirection): INextEditorGroup;
getGroup(identifier: GroupIdentifier): INextEditorGroup;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册