diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index 32a714eb3c9c0..dcd59fa022b17 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -20,7 +20,7 @@ import errors = require('vs/base/common/errors'); import * as DOM from 'vs/base/browser/dom'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { CONTEXT as ToolBarContext, ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; -import { IActionItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; +import { IActionItem, ActionsOrientation, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; import { IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions'; import { Action, IAction } from 'vs/base/common/actions'; @@ -39,6 +39,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachProgressBarStyler } from 'vs/platform/theme/common/styler'; +import { ToggleSidebarVisibilityAction } from 'vs/workbench/browser/actions/toggleSidebarVisibility'; export interface ICompositeTitleLabel { @@ -478,6 +479,10 @@ export abstract class CompositePart extends Part { private onContextMenu(event: StandardMouseEvent): void { const contextMenuActions = this.activeComposite ? this.activeComposite.getContextMenuActions() : []; + if (contextMenuActions.length) { + contextMenuActions.push(new Separator()); + } + contextMenuActions.push(this.createHideSideBarAction()); if (contextMenuActions.length) { let anchor: { x: number, y: number } = { x: event.posx, y: event.posy }; this.contextMenuService.showContextMenu({ @@ -490,6 +495,15 @@ export abstract class CompositePart extends Part { } } + private createHideSideBarAction(): IAction { + return { + id: ToggleSidebarVisibilityAction.ID, + label: nls.localize('compositePart.hideSideBarLabel', "Hide Side Bar"), + enabled: true, + run: () => this.partService.setSideBarHidden(true) + }; + } + private actionItemProvider(action: Action): IActionItem { let actionItem: IActionItem; diff --git a/src/vs/workbench/parts/views/browser/views.ts b/src/vs/workbench/parts/views/browser/views.ts index 454d9431355d1..f33a8c45029d4 100644 --- a/src/vs/workbench/parts/views/browser/views.ts +++ b/src/vs/workbench/parts/views/browser/views.ts @@ -638,7 +638,7 @@ export class ComposedViewsViewlet extends Viewlet { getAnchor: () => anchor, getActions: () => TPromise.as([{ id: `${view.id}.removeView`, - label: nls.localize('removeView', "Remove from {0} View", this.getTitle()), + label: nls.localize('removeView', "Remove from Side Bar"), enabled: true, run: () => this.toggleViewVisibility(view.id) }]),