diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 030e7808f553e..0fa52770f60e3 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -232,6 +232,12 @@ configurationRegistry.registerConfiguration({ 'default': 'left', 'description': nls.localize('sideBarLocation', "Controls the location of the sidebar. It can either show on the left or right of the workbench.") }, + 'workbench.panel.defaultLocation': { + 'type': 'string', + 'enum': ['bottom', 'right'], + 'default': 'bottom', + 'description': nls.localize('panelDefaultLocation', "Controls the default location of the panel. It can either show at the bottom or on the right of the workbench.") + }, 'workbench.statusBar.visible': { 'type': 'boolean', 'default': true, diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index b621527249309..2301bbcf84411 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -152,6 +152,7 @@ export class Workbench implements IPartService { private static readonly panelHiddenStorageKey = 'workbench.panel.hidden'; private static readonly zenModeActiveStorageKey = 'workbench.zenmode.active'; private static readonly panelPositionStorageKey = 'workbench.panel.location'; + private static readonly defaultPanelPositionStorageKey = 'workbench.panel.defaultLocation'; private static readonly sidebarPositionConfigurationKey = 'workbench.sideBar.location'; private static readonly statusbarVisibleConfigurationKey = 'workbench.statusBar.visible'; @@ -635,8 +636,7 @@ export class Workbench implements IPartService { this.sideBarPosition = (sideBarPosition === 'right') ? Position.RIGHT : Position.LEFT; // Panel position - const panelPosition = this.storageService.get(Workbench.panelPositionStorageKey, StorageScope.WORKSPACE, 'bottom'); - this.panelPosition = (panelPosition === 'right') ? Position.RIGHT : Position.BOTTOM; + this.setPanelPositionFromStorageOrConfig(); // Statusbar visibility const statusBarVisible = this.configurationService.getValue(Workbench.statusbarVisibleConfigurationKey); @@ -658,6 +658,12 @@ export class Workbench implements IPartService { }; } + private setPanelPositionFromStorageOrConfig() { + const defaultPanelPosition = this.configurationService.getValue(Workbench.defaultPanelPositionStorageKey); + const panelPosition = this.storageService.get(Workbench.panelPositionStorageKey, StorageScope.WORKSPACE, defaultPanelPosition); + this.panelPosition = (panelPosition === 'right') ? Position.RIGHT : Position.BOTTOM; + } + /** * Returns whether the workbench has been started. */ @@ -1084,6 +1090,8 @@ export class Workbench implements IPartService { this.setSideBarPosition(newSidebarPosition); } + this.setPanelPositionFromStorageOrConfig(); + const fontAliasing = this.configurationService.getValue(Workbench.fontAliasingConfigurationKey); if (fontAliasing !== this.fontAliasing) { this.setFontAliasing(fontAliasing);