diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index b6f7f716b67..1d6942161e9 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -44,7 +44,7 @@ export class LayoutOptions { interface ComputedStyles { activitybar: { minWidth: number; }; sidebar: { minWidth: number; }; - panelPart: { minHeight: number; } + panel: { minHeight: number; } editor: { minWidth: number; }; statusbar: { height: number; }; } @@ -55,7 +55,7 @@ interface ComputedStyles { export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontalSashLayoutProvider { private static sashXWidthSettingsKey = 'workbench.sidebar.width'; - private static sashYHeightSettingsKey = 'workbench.panelpart.height'; + private static sashYHeightSettingsKey = 'workbench.panel.height'; private parent: Builder; private workbenchContainer: Builder; @@ -74,9 +74,9 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal private startSidebarWidth: number; private sidebarWidth: number; private sidebarHeight: number; - private startPanelPartHeight: number; - private panelPartHeight: number; - private panelPartWidth: number; + private startPanelHeight: number; + private panelHeight: number; + private panelWidth: number; // Take parts as an object bag since instatation service does not have typings for constructors with 9+ arguments constructor( @@ -118,7 +118,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal }); this.sidebarWidth = this.storageService.getInteger(WorkbenchLayout.sashXWidthSettingsKey, StorageScope.GLOBAL, -1); - this.panelPartHeight = this.storageService.getInteger(WorkbenchLayout.sashYHeightSettingsKey, StorageScope.GLOBAL, 0); + this.panelHeight = this.storageService.getInteger(WorkbenchLayout.sashYHeightSettingsKey, StorageScope.GLOBAL, 0); this.registerListeners(); this.registerSashListeners(); @@ -139,7 +139,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal }); this.sashY.addListener('start', (e: ISashEvent) => { - this.startPanelPartHeight = this.panelPartHeight; + this.startPanelHeight = this.panelHeight; startY = e.startY; }); @@ -184,15 +184,15 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal this.sashY.addListener('change', (e: ISashEvent) => { let doLayout = false; - let isPanelPartHidden = this.partService.isPanelPartHidden(); - let newSashHeight = this.startPanelPartHeight - (e.currentY - startY); + let isPanelHidden = this.partService.isPanelHidden(); + let newSashHeight = this.startPanelHeight - (e.currentY - startY); // Panel visible - if (!isPanelPartHidden) { + if (!isPanelHidden) { // TODO@Isidor Automatically hide panel when a certain threshold is met - this.panelPartHeight = Math.max(this.computedStyles.panelPart.minHeight, newSashHeight); // Panel can not become smaller than MIN_PART_HEIGHT - doLayout = newSashHeight >= this.computedStyles.panelPart.minHeight; + this.panelHeight = Math.max(this.computedStyles.panel.minHeight, newSashHeight); // Panel can not become smaller than MIN_PART_HEIGHT + doLayout = newSashHeight >= this.computedStyles.panel.minHeight; } if (doLayout) { this.layout(); @@ -203,7 +203,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal this.storageService.store(WorkbenchLayout.sashXWidthSettingsKey, this.sidebarWidth, StorageScope.GLOBAL); }); this.sashY.addListener('end', () => { - this.storageService.store(WorkbenchLayout.sashYHeightSettingsKey, this.panelPartHeight, StorageScope.GLOBAL); + this.storageService.store(WorkbenchLayout.sashYHeightSettingsKey, this.panelHeight, StorageScope.GLOBAL); }); } @@ -249,7 +249,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal minWidth: parseInt(sidebarStyle.getPropertyValue('min-width'), 10) || DEFAULT_MIN_PART_WIDTH }, - panelPart: { + panel: { minHeight: parseInt(panelPartStyle.getPropertyValue('min-height'), 10) || DEFAULT_MIN_PANEL_PART_HEIGHT }, @@ -283,7 +283,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal this.workbenchSize = this.getWorkbenchArea(); const isSidebarHidden = this.partService.isSideBarHidden(); - const isPanelPartHidden = this.partService.isPanelPartHidden(); + const isPanelHidden = this.partService.isPanelHidden(); const sidebarPosition = this.partService.getSideBarPosition(); // Sidebar @@ -306,15 +306,15 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal // Panel part let panelHeight: number; - if (isPanelPartHidden) { + if (isPanelHidden) { panelHeight = 0; - } else if (this.panelPartHeight > 0) { - panelHeight = Math.min(sidebarSize.height * PANEL_HEIGHT_SCREEN_LIMIT, Math.max(this.computedStyles.panelPart.minHeight, this.panelPartHeight)); + } else if (this.panelHeight > 0) { + panelHeight = Math.min(sidebarSize.height * PANEL_HEIGHT_SCREEN_LIMIT, Math.max(this.computedStyles.panel.minHeight, this.panelHeight)); } else { panelHeight = sidebarSize.height * 0.4; } const panelDimension = new Dimension(this.workbenchSize.width - sidebarSize.width - activityBarSize.width, panelHeight); - this.panelPartWidth = panelDimension.width; + this.panelWidth = panelDimension.width; // Editor let editorSize = { @@ -359,9 +359,9 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal this.storageService.store(WorkbenchLayout.sashXWidthSettingsKey, this.sidebarWidth, StorageScope.GLOBAL); } - if (!isPanelPartHidden) { - this.panelPartHeight = panelDimension.height; - this.storageService.store(WorkbenchLayout.sashYHeightSettingsKey, this.panelPartHeight, StorageScope.GLOBAL); + if (!isPanelHidden) { + this.panelHeight = panelDimension.height; + this.storageService.store(WorkbenchLayout.sashYHeightSettingsKey, this.panelHeight, StorageScope.GLOBAL); } // Workbench @@ -419,7 +419,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal // Sashes this.sashX.layout(); - isPanelPartHidden ? this.sashY.hide() : this.sashY.show(); + isPanelHidden ? this.sashY.hide() : this.sashY.show(); this.sashY.layout(); // Propagate to Part Layouts @@ -463,7 +463,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal } public getHorizontalSashTop(sash: Sash): number { - return this.sidebarHeight - this.panelPartHeight; + return this.sidebarHeight - this.panelHeight; } public getHorizontalSashLeft(sash: Sash): number { @@ -471,7 +471,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal } public getHorizontalSashWidth(sash: Sash): number { - return this.panelPartWidth; + return this.panelWidth; } public dispose(): void { diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index c76d760f688..36fec41a130 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -174,7 +174,7 @@ export abstract class CompositePart extends Part { // Fill Content and Actions return createCompositePromise.then(() => { - // Make sure that the user meanwhile did not open another composite or closed the sidebar + // Make sure that the user meanwhile did not open another composite or closed the part containing the composite if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) { return; } @@ -222,7 +222,7 @@ export abstract class CompositePart extends Part { // Indicate to composite that it is now visible return composite.setVisible(true).then(() => { - // Make sure that the user meanwhile did not open another composite or closed the sidebar + // Make sure that the user meanwhile did not open another composite or closed the part containing the composite if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) { return; } diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 2fcf6eac665..3bd3d066677 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -50,10 +50,10 @@ export class PanelPart extends CompositePart implements IPanelService { } // First check if panel part is hidden and show if so - if (this.partService.isPanelPartHidden()) { + if (this.partService.isPanelHidden()) { try { this.blockOpeningPanel = true; - this.partService.setPanelPartHidden(false); + this.partService.setPanelHidden(false); } finally { this.blockOpeningPanel = false; } diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index 674853b0250..ce041a497f6 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -82,7 +82,7 @@ export class Workbench implements IPartService { private static sidebarPositionSettingKey = 'workbench.sidebar.position'; private static sidebarHiddenSettingKey = 'workbench.sidebar.hidden'; - private static panelPartHiddenSettingKey = 'workbench.panelPart.hidden'; + private static panelHiddenSettingKey = 'workbench.panel.hidden'; public serviceId = IPartService; @@ -117,7 +117,7 @@ export class Workbench implements IPartService { private creationPromiseComplete: ValueCallback; private sideBarHidden: boolean; private sideBarPosition: Position; - private panelPartHidden: boolean; + private panelHidden: boolean; private editorBackgroundDelayer: Delayer; constructor(container: HTMLElement, workspace: IWorkspace, configuration: IConfiguration, options: IOptions, instantiationService: IInstantiationService) { @@ -419,9 +419,9 @@ export class Workbench implements IPartService { } // Panel part visibility - this.panelPartHidden = this.storageService.getBoolean(Workbench.panelPartHiddenSettingKey, StorageScope.WORKSPACE, true); + this.panelHidden = this.storageService.getBoolean(Workbench.panelHiddenSettingKey, StorageScope.WORKSPACE, true); if (!!this.workbenchParams.options.singleFileMode) { - this.panelPartHidden = true; // we hide panel part in single-file-mode + this.panelHidden = true; // we hide panel part in single-file-mode } // Sidebar position @@ -484,7 +484,7 @@ export class Workbench implements IPartService { return !this.sideBarHidden; } if (part === Parts.PANEL_PART) { - return !this.panelPartHidden; + return !this.panelHidden; } return true; // any other part cannot be hidden @@ -533,12 +533,12 @@ export class Workbench implements IPartService { this.storageService.store(Workbench.sidebarHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); } - public isPanelPartHidden(): boolean { - return this.panelPartHidden; + public isPanelHidden(): boolean { + return this.panelHidden; } - public setPanelPartHidden(hidden: boolean, skipLayout?:boolean): void { - this.panelPartHidden = hidden; + public setPanelHidden(hidden: boolean, skipLayout?:boolean): void { + this.panelHidden = hidden; // Layout if (!skipLayout) { @@ -566,7 +566,7 @@ export class Workbench implements IPartService { } // Remember in settings - this.storageService.store(Workbench.panelPartHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); + this.storageService.store(Workbench.panelHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); } public getSideBarPosition(): Position { diff --git a/src/vs/workbench/common/constants.ts b/src/vs/workbench/common/constants.ts index 1c57d02330d..651e9eff513 100644 --- a/src/vs/workbench/common/constants.ts +++ b/src/vs/workbench/common/constants.ts @@ -16,7 +16,7 @@ export const Identifiers = { WORKBENCH_CONTAINER: 'workbench.main.container', ACTIVITYBAR_PART: 'workbench.parts.activitybar', SIDEBAR_PART: 'workbench.parts.sidebar', - PANEL_PART: 'workbench.parts.panelpart', + PANEL_PART: 'workbench.parts.panel', EDITOR_PART: 'workbench.parts.editor', STATUSBAR_PART: 'workbench.parts.statusbar' }; diff --git a/src/vs/workbench/services/part/common/partService.ts b/src/vs/workbench/services/part/common/partService.ts index 75e489b07ae..fa247ef87ba 100644 --- a/src/vs/workbench/services/part/common/partService.ts +++ b/src/vs/workbench/services/part/common/partService.ts @@ -63,12 +63,12 @@ export interface IPartService { /** * Checks if the panel part is currently hidden or not */ - isPanelPartHidden(): boolean; + isPanelHidden(): boolean; /** * Set panel part hidden or not */ - setPanelPartHidden(hidden: boolean): void; + setPanelHidden(hidden: boolean): void; /** * Gets the current side bar position. Note that the sidebar can be hidden too. diff --git a/src/vs/workbench/test/browser/servicesTestUtils.ts b/src/vs/workbench/test/browser/servicesTestUtils.ts index ef531e32e70..38a73dd7770 100644 --- a/src/vs/workbench/test/browser/servicesTestUtils.ts +++ b/src/vs/workbench/test/browser/servicesTestUtils.ts @@ -212,11 +212,11 @@ export class TestPartService implements PartService.IPartService { public setSideBarHidden(hidden: boolean): void { } - public isPanelPartHidden(): boolean { + public isPanelHidden(): boolean { return false; } - public setPanelPartHidden(hidden: boolean): void { } + public setPanelHidden(hidden: boolean): void { } public getSideBarPosition() { return 0;