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

grid - some feedback wip

上级 239c0452
...@@ -35,6 +35,8 @@ export class NextEditorGroupView extends Themable implements IView { ...@@ -35,6 +35,8 @@ export class NextEditorGroupView extends Themable implements IView {
private group: EditorGroup; private group: EditorGroup;
private dimension: Dimension;
private _element: HTMLElement; private _element: HTMLElement;
private container: HTMLElement; private container: HTMLElement;
...@@ -52,6 +54,14 @@ export class NextEditorGroupView extends Themable implements IView { ...@@ -52,6 +54,14 @@ export class NextEditorGroupView extends Themable implements IView {
this.group.label = `Group <${this.group.id}>`; 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 { openEditor(input: EditorInput, options?: EditorOptions): INextEditor {
// Update model // Update model
...@@ -66,13 +76,7 @@ export class NextEditorGroupView extends Themable implements IView { ...@@ -66,13 +76,7 @@ export class NextEditorGroupView extends Themable implements IView {
return Object.create(null); // TODO@grid implement return Object.create(null); // TODO@grid implement
} }
get element(): HTMLElement { //#region Themable Implementation
return this._element;
}
get id(): GroupIdentifier {
return this.group.id;
}
protected updateStyles(): void { protected updateStyles(): void {
super.updateStyles(); super.updateStyles();
...@@ -92,6 +96,10 @@ export class NextEditorGroupView extends Themable implements IView { ...@@ -92,6 +96,10 @@ export class NextEditorGroupView extends Themable implements IView {
// TODO@grid Editor container border // TODO@grid Editor container border
} }
//#endregion
//#region IView implementation
render(container: HTMLElement): void { render(container: HTMLElement): void {
// TODO@grid simplify containers by flattening the hierarchy more? // TODO@grid simplify containers by flattening the hierarchy more?
...@@ -138,9 +146,14 @@ export class NextEditorGroupView extends Themable implements IView { ...@@ -138,9 +146,14 @@ export class NextEditorGroupView extends Themable implements IView {
this.updateStyles(); 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 // Layout title if present
// this.titleAreaControl.layout(new Dimension(size, NextEditorGroupView.EDITOR_TITLE_HEIGHT)); 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 { ...@@ -45,7 +45,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
this._onLayout = this._register(new Emitter<Dimension>()); this._onLayout = this._register(new Emitter<Dimension>());
this.createGrid(); this.doCreateGridView();
} }
//#region Service Implementation //#region Service Implementation
...@@ -62,6 +62,17 @@ export class NextEditorPart extends Part implements INextEditorPartService { ...@@ -62,6 +62,17 @@ export class NextEditorPart extends Part implements INextEditorPartService {
return this._groups.get(identifier); 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 //#endregion
//#region Grid Controller //#region Grid Controller
...@@ -97,7 +108,7 @@ export class NextEditorPart extends Part implements INextEditorPartService { ...@@ -97,7 +108,7 @@ export class NextEditorPart extends Part implements INextEditorPartService {
return this._onLayout.event; return this._onLayout.event;
} }
private createGrid(): void { private doCreateGridView(): void {
// Container // Container
this.gridContainer = document.createElement('div'); this.gridContainer = document.createElement('div');
......
...@@ -40,5 +40,7 @@ export interface INextEditorPartService { ...@@ -40,5 +40,7 @@ export interface INextEditorPartService {
readonly activeGroup: INextEditorGroup; readonly activeGroup: INextEditorGroup;
readonly groups: INextEditorGroup[]; readonly groups: INextEditorGroup[];
// addGroup(group: GroupIdentifier, direction: SplitDirection): INextEditorGroup;
getGroup(identifier: GroupIdentifier): 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.
先完成此消息的编辑!
想要评论请 注册