From 757bf29c93f3434e224d093558d64b054928d277 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 24 Oct 2017 16:42:20 +0200 Subject: [PATCH] composite bar fix min width issue --- src/vs/workbench/browser/layout.ts | 2 +- src/vs/workbench/browser/parts/compositebar/compositeBar.ts | 2 +- src/vs/workbench/browser/parts/panel/panelPart.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index b17221162b8..d298147bd8e 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -24,7 +24,7 @@ const MIN_SIDEBAR_PART_WIDTH = 170; const MIN_EDITOR_PART_HEIGHT = 70; const MIN_EDITOR_PART_WIDTH = 220; const MIN_PANEL_PART_HEIGHT = 77; -const MIN_PANEL_PART_WIDTH = 150; +const MIN_PANEL_PART_WIDTH = 220; const DEFAULT_PANEL_SIZE_COEFFICIENT = 0.4; const HIDE_SIDEBAR_WIDTH_THRESHOLD = 50; const HIDE_PANEL_HEIGHT_THRESHOLD = 50; diff --git a/src/vs/workbench/browser/parts/compositebar/compositeBar.ts b/src/vs/workbench/browser/parts/compositebar/compositeBar.ts index bbc33698401..2a1a311acfe 100644 --- a/src/vs/workbench/browser/parts/compositebar/compositeBar.ts +++ b/src/vs/workbench/browser/parts/compositebar/compositeBar.ts @@ -281,7 +281,7 @@ export class CompositeBar implements ICompositeBar { } // Add overflow action as needed - if (visibleCompositesChange && overflows) { + if ((visibleCompositesChange && overflows) || this.compositeSwitcherBar.length() === 0) { this.compositeOverflowAction = this.instantiationService.createInstance(CompositeOverflowActivityAction, () => this.compositeOverflowActionItem.showMenu()); this.compositeOverflowActionItem = this.instantiationService.createInstance( CompositeOverflowActivityActionItem, diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 6de483e3d23..949d3135c52 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -36,6 +36,7 @@ export class PanelPart extends CompositePart implements IPanelService { public static activePanelSettingsKey = 'workbench.panelpart.activepanelid'; private static readonly PINNED_PANELS = 'workbench.panel.pinnedPanels'; + private static readonly MIN_COMPOSITE_BAR_WIDTH = 50; public _serviceBrand: any; @@ -225,7 +226,7 @@ export class PanelPart extends CompositePart implements IPanelService { let availableWidth = this.dimension.width - 8; // take padding into account if (this.toolBar) { // adjust height for global actions showing - availableWidth -= this.toolBar.getContainer().getHTMLElement().offsetWidth; + availableWidth = Math.max(PanelPart.MIN_COMPOSITE_BAR_WIDTH, availableWidth - this.toolBar.getContainer().getHTMLElement().offsetWidth); } this.compositeBar.layout(new Dimension(availableWidth, this.dimension.height)); } -- GitLab