mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 01:37:20 +00:00
Merge pull request #130854 from jeanp413/fix-130725
Fixes notebook UI displayed over terminal
This commit is contained in:
commit
eab604688a
1 changed files with 11 additions and 8 deletions
|
@ -1582,23 +1582,26 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
return;
|
||||
}
|
||||
|
||||
const topInserToolbarHeight = this._notebookOptions.computeTopInserToolbarHeight(this.viewModel?.viewType);
|
||||
|
||||
this._dimension = new DOM.Dimension(dimension.width, dimension.height);
|
||||
DOM.size(this._body, dimension.width, dimension.height - (this._notebookTopToolbar?.useGlobalToolbar ? /** Toolbar height */ 26 : 0));
|
||||
if (this._list.getRenderHeight() < dimension.height - topInserToolbarHeight) {
|
||||
const newBodyHeight = Math.max(dimension.height - (this._notebookTopToolbar?.useGlobalToolbar ? /** Toolbar height */ 26 : 0), 0);
|
||||
DOM.size(this._body, dimension.width, newBodyHeight);
|
||||
|
||||
const topInserToolbarHeight = this._notebookOptions.computeTopInserToolbarHeight(this.viewModel?.viewType);
|
||||
const newCellListHeight = Math.max(dimension.height - topInserToolbarHeight, 0);
|
||||
if (this._list.getRenderHeight() < newCellListHeight) {
|
||||
// the new dimension is larger than the list viewport, update its additional height first, otherwise the list view will move down a bit (as the `scrollBottom` will move down)
|
||||
this._list.updateOptions({ additionalScrollHeight: this._allowScrollBeyondLastLine() ? Math.max(0, (dimension.height - topInserToolbarHeight - 50)) : topInserToolbarHeight });
|
||||
this._list.layout(dimension.height - topInserToolbarHeight, dimension.width);
|
||||
this._list.updateOptions({ additionalScrollHeight: this._allowScrollBeyondLastLine() ? Math.max(0, (newCellListHeight - 50)) : topInserToolbarHeight });
|
||||
this._list.layout(newCellListHeight, dimension.width);
|
||||
} else {
|
||||
// the new dimension is smaller than the list viewport, if we update the additional height, the `scrollBottom` will move up, which moves the whole list view upwards a bit. So we run a layout first.
|
||||
this._list.layout(dimension.height - topInserToolbarHeight, dimension.width);
|
||||
this._list.updateOptions({ additionalScrollHeight: this._allowScrollBeyondLastLine() ? Math.max(0, (dimension.height - topInserToolbarHeight - 50)) : topInserToolbarHeight });
|
||||
this._list.layout(newCellListHeight, dimension.width);
|
||||
this._list.updateOptions({ additionalScrollHeight: this._allowScrollBeyondLastLine() ? Math.max(0, (newCellListHeight - 50)) : topInserToolbarHeight });
|
||||
}
|
||||
|
||||
this._overlayContainer.style.visibility = 'visible';
|
||||
this._overlayContainer.style.display = 'block';
|
||||
this._overlayContainer.style.position = 'absolute';
|
||||
this._overlayContainer.style.overflow = 'hidden';
|
||||
|
||||
const containerRect = this._overlayContainer.parentElement?.getBoundingClientRect();
|
||||
this._overlayContainer.style.top = `${this._shadowElementViewInfo!.top - (containerRect?.top || 0)}px`;
|
||||
|
|
Loading…
Reference in a new issue