-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40757 from SrTobi-Forks/master
added Center Mode (#15684)
- Loading branch information
Showing
7 changed files
with
280 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { TPromise } from 'vs/base/common/winjs.base'; | ||
import nls = require('vs/nls'); | ||
import { Action } from 'vs/base/common/actions'; | ||
import { Registry } from 'vs/platform/registry/common/platform'; | ||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; | ||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; | ||
import { IPartService } from 'vs/workbench/services/part/common/partService'; | ||
|
||
class ToggleCenteredLayout extends Action { | ||
|
||
public static readonly ID = 'workbench.action.toggleCenteredLayout'; | ||
public static readonly LABEL = nls.localize('toggleCenteredLayout', "Toggle Centered Layout"); | ||
|
||
constructor( | ||
id: string, | ||
label: string, | ||
@IPartService private partService: IPartService | ||
) { | ||
super(id, label); | ||
this.enabled = !!this.partService; | ||
} | ||
|
||
public run(): TPromise<any> { | ||
this.partService.toggleCenteredEditorLayout(); | ||
|
||
return TPromise.as(null); | ||
} | ||
} | ||
|
||
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions); | ||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleCenteredLayout, ToggleCenteredLayout.ID, ToggleCenteredLayout.LABEL), 'View: Toggle Centered Layout', nls.localize('view', "View")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.