Merge from vscode 709a07d51919d3266ca71699c6ddfb2d3547c0e1 (#6575)

This commit is contained in:
Chris LaFreniere
2019-08-02 21:06:44 -07:00
committed by GitHub
parent 402b50c03b
commit 62d2fb534d
103 changed files with 726 additions and 374 deletions

View File

@@ -587,7 +587,7 @@ export class CustomMenubarControl extends MenubarControl {
this.updateService.checkForUpdates({ windowId }));
case StateType.CheckingForUpdates:
return new Action('update.checking', nls.localize('checkingForUpdates', "Checking For Updates..."), undefined, false);
return new Action('update.checking', nls.localize('checkingForUpdates', "Checking for Updates..."), undefined, false);
case StateType.AvailableForDownload:
return new Action('update.downloadNow', nls.localize({ key: 'download now', comment: ['&& denotes a mnemonic'] }, "D&&ownload Now"), undefined, true, () =>

View File

@@ -76,8 +76,8 @@ export class CustomTreeViewPanel extends ViewletPanel {
this.treeView.show(container);
}
layoutBody(size: number): void {
this.treeView.layout(size);
layoutBody(height: number, width: number): void {
this.treeView.layout(height, width);
}
getActions(): IAction[] {
@@ -329,11 +329,11 @@ export class CustomTreeView extends Disposable implements ITreeView {
this._onDidChangeVisibility.fire(this.isVisible);
}
focus(): void {
focus(reveal: boolean = true): void {
if (this.tree && this.root.children && this.root.children.length > 0) {
// Make sure the current selected element is revealed
const selectedElement = this.tree.getSelection()[0];
if (selectedElement) {
if (selectedElement && reveal) {
this.tree.reveal(selectedElement, 0.5);
}
@@ -384,7 +384,8 @@ export class CustomTreeView extends Disposable implements ITreeView {
expandOnlyOnTwistieClick: (e: ITreeItem) => !!e.command,
collapseByDefault: (e: ITreeItem): boolean => {
return e.collapsibleState !== TreeItemCollapsibleState.Expanded;
}
},
multipleSelectionSupport: false
}));
aligner.tree = this.tree;
@@ -480,14 +481,14 @@ export class CustomTreeView extends Disposable implements ITreeView {
this.markdownResult = this.markdownRenderer.render(this._messageValue);
DOM.append(this.messageElement, this.markdownResult.element);
}
this.layout(this._size);
this.layout(this._height, this._width);
}
}
private hideMessage(): void {
this.resetMessageElement();
DOM.addClass(this.messageElement, 'hide');
this.layout(this._size);
this.layout(this._height, this._width);
}
private resetMessageElement(): void {
@@ -498,14 +499,16 @@ export class CustomTreeView extends Disposable implements ITreeView {
DOM.clearNode(this.messageElement);
}
private _size: number;
layout(size: number) {
if (size) {
this._size = size;
const treeSize = size - DOM.getTotalHeight(this.messageElement);
this.treeContainer.style.height = treeSize + 'px';
private _height: number;
private _width: number;
layout(height: number, width: number) {
if (height && width) {
this._height = height;
this._width = width;
const treeHeight = height - DOM.getTotalHeight(this.messageElement);
this.treeContainer.style.height = treeHeight + 'px';
if (this.tree) {
this.tree.layout(treeSize);
this.tree.layout(treeHeight, width);
}
}
}
@@ -595,10 +598,11 @@ export class CustomTreeView extends Disposable implements ITreeView {
if (this.tree) {
this.refreshing = true;
await Promise.all(elements.map(element => this.tree.updateChildren(element, true)));
elements.map(element => this.tree.rerender(element));
this.refreshing = false;
this.updateContentAreas();
if (this.focused) {
this.focus();
this.focus(false);
}
}
}

View File

@@ -104,6 +104,7 @@
.customview-tree .monaco-list .monaco-list-row {
padding-right: 12px;
padding-left: 0px;
}
.customview-tree .monaco-list .monaco-list-row .custom-view-tree-node-item {

View File

@@ -556,7 +556,8 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
visibleGlobal: undefined,
visibleWorkspace: isUndefined(workspaceViewState.isHidden) ? undefined : !workspaceViewState.isHidden,
collapsed: workspaceViewState.collapsed,
order: workspaceViewState.order
order: workspaceViewState.order,
size: workspaceViewState.size
});
}