Skip to content

Commit

Permalink
fixes #90177
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Feb 12, 2020
1 parent 57ac3ed commit 4b0c906
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/views/viewPaneContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export abstract class ViewPane extends Pane implements IView {
private readonly menuActions: ViewMenuActions;

protected actionRunner?: IActionRunner;
protected toolbar?: ToolBar;
private toolbar?: ToolBar;
private readonly showActionsAlways: boolean = false;
private headerContainer?: HTMLElement;
private titleContainer?: HTMLElement;
Expand Down
17 changes: 10 additions & 7 deletions src/vs/workbench/contrib/debug/browser/callStackView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,11 @@ export class CallStackView extends ViewPane {
this.pauseMessageLabel.title = thread.stoppedDetails.text || '';
dom.toggleClass(this.pauseMessageLabel, 'exception', thread.stoppedDetails.reason === 'exception');
this.pauseMessage.hidden = false;
if (this.toolbar) {
this.toolbar.setActions([])();
}
this.updateActions();

} else {
this.pauseMessage.hidden = true;
if (this.toolbar) {
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
this.toolbar.setActions([collapseAction])();
}
this.updateActions();
}

this.needsRefresh = false;
Expand All @@ -153,6 +148,14 @@ export class CallStackView extends ViewPane {
this.pauseMessageLabel = dom.append(this.pauseMessage, $('span.label'));
}

getActions(): IAction[] {
if (this.pauseMessage.hidden) {
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
}

return [];
}

renderBody(container: HTMLElement): void {
super.renderBody(container);

Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/contrib/debug/browser/variablesView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ export class VariablesView extends ViewPane {

CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService);

if (this.toolbar) {
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
this.toolbar.setActions([collapseAction])();
}
this.tree.updateChildren();

this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
Expand Down Expand Up @@ -154,6 +150,10 @@ export class VariablesView extends ViewPane {
}));
}

getActions(): IAction[] {
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
}

layoutBody(width: number, height: number): void {
this.tree.layout(width, height);
}
Expand Down
15 changes: 8 additions & 7 deletions src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ export class WatchExpressionsView extends ViewPane {
this.tree.setInput(this.debugService);
CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);

if (this.toolbar) {
const addWatchExpressionAction = new AddWatchExpressionAction(AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL, this.debugService, this.keybindingService);
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
const removeAllWatchExpressionsAction = new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService);
this.toolbar.setActions([addWatchExpressionAction, collapseAction, removeAllWatchExpressionsAction])();
}

this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
this._register(this.debugService.getModel().onDidChangeWatchExpressions(async we => {
Expand Down Expand Up @@ -160,6 +153,14 @@ export class WatchExpressionsView extends ViewPane {
this.tree.domFocus();
}

getActions(): IAction[] {
return [
new AddWatchExpressionAction(AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL, this.debugService, this.keybindingService),
new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all'),
new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService)
];
}

private onMouseDblClick(e: ITreeMouseEvent<IExpression>): void {
if ((e.browserEvent.target as HTMLElement).className.indexOf('twistie') >= 0) {
// Ignore double click events on twistie
Expand Down
4 changes: 0 additions & 4 deletions src/vs/workbench/contrib/files/browser/views/explorerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ export class ExplorerView extends ViewPane {

this.createTree(treeContainer);

if (this.toolbar) {
this.toolbar.setActions(this.getActions(), this.getSecondaryActions())();
}

this._register(this.labelService.onDidChangeFormatters(() => {
this._onDidChangeTitleArea.fire();
}));
Expand Down

0 comments on commit 4b0c906

Please sign in to comment.