From ebb728469ac0858c5116847cd2e716ced09f71d6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 12 Sep 2019 15:57:07 +0200 Subject: [PATCH] calls - fix split view issues --- .../contrib/referenceSearch/peekViewWidget.ts | 2 +- .../browser/callHierarchyPeek.ts | 20 ++++++++++++------- .../browser/media/callHierarchy.css | 7 ++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts index 16d358dd7a4..28686406148 100644 --- a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts @@ -218,7 +218,7 @@ export abstract class PeekViewWidget extends ZoneWidget { } const headHeight = Math.ceil(this.editor.getOption(EditorOption.lineHeight) * 1.2); - const bodyHeight = heightInPixel - (headHeight + 2 /* the border-top/bottom width*/); + const bodyHeight = Math.round(heightInPixel - (headHeight + 2 /* the border-top/bottom width*/)); this._doLayoutHead(headHeight, widthInPixel); this._doLayoutBody(bodyHeight, widthInPixel); diff --git a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts index d9b68c781ae..5a2f1003b10 100644 --- a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts +++ b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts @@ -220,7 +220,9 @@ export class CallHierarchyTreePeekWidget extends PeekViewWidget { minimumSize: 200, maximumSize: Number.MAX_VALUE, layout: (width) => { - this._editor.layout({ height: this._dim.height, width }); + if (this._dim.height) { + this._editor.layout({ height: this._dim.height, width }); + } } }, Sizing.Distribute); @@ -230,7 +232,9 @@ export class CallHierarchyTreePeekWidget extends PeekViewWidget { minimumSize: 100, maximumSize: Number.MAX_VALUE, layout: (width) => { - this._tree.layout(this._dim.height, width); + if (this._dim.height) { + this._tree.layout(this._dim.height, width); + } } }, Sizing.Distribute); @@ -424,11 +428,13 @@ export class CallHierarchyTreePeekWidget extends PeekViewWidget { } protected _doLayoutBody(height: number, width: number): void { - super._doLayoutBody(height, width); - this._dim = { height, width }; - this._layoutInfo.height = this._viewZone ? this._viewZone.heightInLines : this._layoutInfo.height; - this._splitView.layout(width); - this._splitView.resizeView(0, width * this._layoutInfo.ratio); + if (this._dim.height !== height || this._dim.width === width) { + super._doLayoutBody(height, width); + this._dim = { height, width }; + this._layoutInfo.height = this._viewZone ? this._viewZone.heightInLines : this._layoutInfo.height; + this._splitView.layout(width); + this._splitView.resizeView(0, width * this._layoutInfo.ratio); + } } } diff --git a/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css b/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css index 9935878905d..ede412d0c4a 100644 --- a/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css +++ b/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css @@ -10,6 +10,7 @@ .monaco-workbench .call-hierarchy[data-state="data"] .results { display: inherit; + height: 100%; } .monaco-workbench .call-hierarchy[data-state="message"] .message { @@ -33,11 +34,7 @@ background-position: left center; } -.monaco-workbench .call-hierarchy .monaco-split-view2.horizontal > .split-view-container > .split-view-view { - /* this is a little bizare.. */ - height: unset; -} - +.monaco-workbench .call-hierarchy .editor, .monaco-workbench .call-hierarchy .tree { height: 100%; } -- GitLab