mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./gridview';
|
||||
import { Event, anyEvent, Emitter, mapEvent, Relay } from 'vs/base/common/event';
|
||||
import { Event, Emitter, Relay } from 'vs/base/common/event';
|
||||
import { Orientation, Sash } from 'vs/base/browser/ui/sash/sash';
|
||||
import { SplitView, IView as ISplitView, Sizing, LayoutPriority, ISplitViewStyles } from 'vs/base/browser/ui/splitview/splitview';
|
||||
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -21,10 +21,10 @@ export interface IView {
|
||||
readonly maximumWidth: number;
|
||||
readonly minimumHeight: number;
|
||||
readonly maximumHeight: number;
|
||||
readonly onDidChange: Event<{ width: number; height: number; }>;
|
||||
readonly onDidChange: Event<{ width: number; height: number; } | undefined>;
|
||||
readonly priority?: LayoutPriority;
|
||||
readonly snapSize?: number;
|
||||
layout(width: number, height: number): void;
|
||||
layout(width: number, height: number, orientation: Orientation): void;
|
||||
}
|
||||
|
||||
export function orthogonal(orientation: Orientation): Orientation {
|
||||
@@ -147,10 +147,10 @@ class BranchNode implements ISplitView, IDisposable {
|
||||
this._orthogonalSize = orthogonalSize;
|
||||
|
||||
this.element = $('.monaco-grid-branch-node');
|
||||
this.splitview = new SplitView(this.element, { orientation, styles });
|
||||
this.splitview = new SplitView(this.element, { orientation, styles, proportionalLayout });
|
||||
this.splitview.layout(size);
|
||||
|
||||
const onDidSashReset = mapEvent(this.splitview.onDidSashReset, i => [i]);
|
||||
const onDidSashReset = Event.map(this.splitview.onDidSashReset, i => [i]);
|
||||
this.splitviewSashResetDisposable = onDidSashReset(this._onDidSashReset.fire, this._onDidSashReset);
|
||||
}
|
||||
|
||||
@@ -300,15 +300,15 @@ class BranchNode implements ISplitView, IDisposable {
|
||||
}
|
||||
|
||||
private onDidChildrenChange(): void {
|
||||
const onDidChildrenChange = anyEvent(...this.children.map(c => c.onDidChange));
|
||||
const onDidChildrenChange = Event.map(Event.any(...this.children.map(c => c.onDidChange)), () => undefined);
|
||||
this.childrenChangeDisposable.dispose();
|
||||
this.childrenChangeDisposable = onDidChildrenChange(this._onDidChange.fire, this._onDidChange);
|
||||
|
||||
const onDidChildrenSashReset = anyEvent(...this.children.map((c, i) => mapEvent(c.onDidSashReset, location => [i, ...location])));
|
||||
const onDidChildrenSashReset = Event.any(...this.children.map((c, i) => Event.map(c.onDidSashReset, location => [i, ...location])));
|
||||
this.childrenSashResetDisposable.dispose();
|
||||
this.childrenSashResetDisposable = onDidChildrenSashReset(this._onDidSashReset.fire, this._onDidSashReset);
|
||||
|
||||
this._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
trySet2x2(other: BranchNode): IDisposable {
|
||||
@@ -348,8 +348,8 @@ class BranchNode implements ISplitView, IDisposable {
|
||||
mySash.linkedSash = otherSash;
|
||||
otherSash.linkedSash = mySash;
|
||||
|
||||
this._onDidChange.fire();
|
||||
other._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
other._onDidChange.fire(undefined);
|
||||
|
||||
return toDisposable(() => {
|
||||
mySash.linkedSash = otherSash.linkedSash = undefined;
|
||||
@@ -391,7 +391,7 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
set linkedWidthNode(node: LeafNode | undefined) {
|
||||
this._onDidLinkedWidthNodeChange.input = node ? node._onDidViewChange : Event.None;
|
||||
this._linkedWidthNode = node;
|
||||
this._onDidSetLinkedNode.fire();
|
||||
this._onDidSetLinkedNode.fire(undefined);
|
||||
}
|
||||
|
||||
private _onDidLinkedHeightNodeChange = new Relay<number | undefined>();
|
||||
@@ -400,7 +400,7 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
set linkedHeightNode(node: LeafNode | undefined) {
|
||||
this._onDidLinkedHeightNodeChange.input = node ? node._onDidViewChange : Event.None;
|
||||
this._linkedHeightNode = node;
|
||||
this._onDidSetLinkedNode.fire();
|
||||
this._onDidSetLinkedNode.fire(undefined);
|
||||
}
|
||||
|
||||
private _onDidSetLinkedNode = new Emitter<number | undefined>();
|
||||
@@ -414,8 +414,8 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
) {
|
||||
this._orthogonalSize = orthogonalSize;
|
||||
|
||||
this._onDidViewChange = mapEvent(this.view.onDidChange, this.orientation === Orientation.HORIZONTAL ? e => e && e.width : e => e && e.height);
|
||||
this.onDidChange = anyEvent(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event);
|
||||
this._onDidViewChange = Event.map(this.view.onDidChange, e => e && (this.orientation === Orientation.VERTICAL ? e.width : e.height));
|
||||
this.onDidChange = Event.any(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event);
|
||||
}
|
||||
|
||||
get width(): number {
|
||||
@@ -480,12 +480,12 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
|
||||
layout(size: number): void {
|
||||
this._size = size;
|
||||
return this.view.layout(this.width, this.height);
|
||||
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
}
|
||||
|
||||
orthogonalLayout(size: number): void {
|
||||
this._orthogonalSize = size;
|
||||
return this.view.layout(this.width, this.height);
|
||||
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
}
|
||||
|
||||
dispose(): void { }
|
||||
@@ -547,7 +547,7 @@ export class GridView implements IDisposable {
|
||||
this._root = root;
|
||||
this.element.appendChild(root.element);
|
||||
this.onDidSashResetRelay.input = root.onDidSashReset;
|
||||
this._onDidChange.input = mapEvent(root.onDidChange, () => undefined); // TODO
|
||||
this._onDidChange.input = Event.map(root.onDidChange, () => undefined); // TODO
|
||||
}
|
||||
|
||||
get orientation(): Orientation {
|
||||
@@ -802,8 +802,7 @@ export class GridView implements IDisposable {
|
||||
const children: GridNode[] = [];
|
||||
let offset = 0;
|
||||
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
const child = node.children[i];
|
||||
for (const child of node.children) {
|
||||
const childOrientation = orthogonal(orientation);
|
||||
const childBox: Box = orientation === Orientation.HORIZONTAL
|
||||
? { top: box.top, left: box.left + offset, width: child.width, height: box.height }
|
||||
|
||||
Reference in New Issue
Block a user