提交 6d624ae2 编写于 作者: J Joao Moreno

fixes #79068

上级 5045e486
...@@ -179,27 +179,8 @@ export class Sash extends Disposable { ...@@ -179,27 +179,8 @@ export class Sash extends Disposable {
let isMultisashResize = false; let isMultisashResize = false;
if (this.linkedSash && !(e as any).__linkedSashEvent) {
(e as any).__linkedSashEvent = true;
this.linkedSash.onMouseDown(e);
}
if (!(e as any).__orthogonalSashEvent) { if (!(e as any).__orthogonalSashEvent) {
let orthogonalSash: Sash | undefined; const orthogonalSash = this.getOrthogonalSash(e);
if (this.orientation === Orientation.VERTICAL) {
if (e.offsetY <= 4) {
orthogonalSash = this.orthogonalStartSash;
} else if (e.offsetY >= this.el.clientHeight - 4) {
orthogonalSash = this.orthogonalEndSash;
}
} else {
if (e.offsetX <= 4) {
orthogonalSash = this.orthogonalStartSash;
} else if (e.offsetX >= this.el.clientWidth - 4) {
orthogonalSash = this.orthogonalEndSash;
}
}
if (orthogonalSash) { if (orthogonalSash) {
isMultisashResize = true; isMultisashResize = true;
...@@ -208,6 +189,11 @@ export class Sash extends Disposable { ...@@ -208,6 +189,11 @@ export class Sash extends Disposable {
} }
} }
if (this.linkedSash && !(e as any).__linkedSashEvent) {
(e as any).__linkedSashEvent = true;
this.linkedSash.onMouseDown(e);
}
if (!this.state) { if (!this.state) {
return; return;
} }
...@@ -295,7 +281,17 @@ export class Sash extends Disposable { ...@@ -295,7 +281,17 @@ export class Sash extends Disposable {
domEvent(window, 'mouseup')(onMouseUp, null, disposables); domEvent(window, 'mouseup')(onMouseUp, null, disposables);
} }
private onMouseDoubleClick(event: MouseEvent): void { private onMouseDoubleClick(e: MouseEvent): void {
const orthogonalSash = this.getOrthogonalSash(e);
if (orthogonalSash) {
orthogonalSash._onDidReset.fire();
}
if (this.linkedSash) {
this.linkedSash._onDidReset.fire();
}
this._onDidReset.fire(); this._onDidReset.fire();
} }
...@@ -386,6 +382,24 @@ export class Sash extends Disposable { ...@@ -386,6 +382,24 @@ export class Sash extends Disposable {
toggleClass(this.el, 'orthogonal-end', state !== SashState.Disabled); toggleClass(this.el, 'orthogonal-end', state !== SashState.Disabled);
} }
private getOrthogonalSash(e: MouseEvent): Sash | undefined {
if (this.orientation === Orientation.VERTICAL) {
if (e.offsetY <= 4) {
return this.orthogonalStartSash;
} else if (e.offsetY >= this.el.clientHeight - 4) {
return this.orthogonalEndSash;
}
} else {
if (e.offsetX <= 4) {
return this.orthogonalStartSash;
} else if (e.offsetX >= this.el.clientWidth - 4) {
return this.orthogonalEndSash;
}
}
return undefined;
}
dispose(): void { dispose(): void {
super.dispose(); super.dispose();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册