提交 e0f1f446 编写于 作者: B Benjamin Pasero

implement sash for horizontal

上级 aaf7b701
......@@ -72,9 +72,6 @@ export class Sash extends EventEmitter {
this.$e.on(DOM.EventType.DBLCLICK, (e: MouseEvent) => { this.emit('reset', e); });
this.$e.on(EventType.Start, (e: GestureEvent) => { this.onTouchStart(e); });
this.orientation = options.orientation || Orientation.VERTICAL;
this.$e.addClass(this.getOrientation());
this.size = options.baseSize || 5;
if (isIPad) {
......@@ -82,11 +79,7 @@ export class Sash extends EventEmitter {
this.$e.addClass('touch');
}
if (this.orientation === Orientation.HORIZONTAL) {
this.$e.size(null, this.size);
} else {
this.$e.size(this.size);
}
this.setOrientation(options.orientation || Orientation.VERTICAL);
this.isDisabled = false;
this.hidden = false;
......@@ -97,6 +90,23 @@ export class Sash extends EventEmitter {
return this.$e.getHTMLElement();
}
public setOrientation(orientation: Orientation): void {
this.orientation = orientation;
this.$e.removeClass('horizontal', 'vertical');
this.$e.addClass(this.getOrientation());
if (this.orientation === Orientation.HORIZONTAL) {
this.$e.size(null, this.size);
} else {
this.$e.size(this.size);
}
if (this.layoutProvider) {
this.layout();
}
}
private getOrientation(): 'horizontal' | 'vertical' {
return this.orientation === Orientation.HORIZONTAL ? 'horizontal' : 'vertical';
}
......
......@@ -754,7 +754,7 @@ export class EvenGroupWidthsAction extends Action {
}
public run(): TPromise<any> {
this.editorGroupService.arrangeGroups(GroupArrangement.EVEN_WIDTH);
this.editorGroupService.arrangeGroups(GroupArrangement.EVEN);
return TPromise.as(false);
}
......
......@@ -12,7 +12,7 @@ import Event from 'vs/base/common/event';
export enum GroupArrangement {
MINIMIZE_OTHERS,
EVEN_WIDTH
EVEN
}
export const IEditorGroupService = createDecorator<IEditorGroupService>('editorGroupService');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册