mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Merge pull request #193224 from microsoft/aamunger/scrollNotebooks
account for toolbar size when measuring initial body height
This commit is contained in:
commit
9892b66efe
|
@ -1512,7 +1512,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
}));
|
||||
|
||||
if (this._dimension) {
|
||||
this._list.layout(this._dimension.height, this._dimension.width);
|
||||
this._list.layout(this.getBodyHeight(this._dimension.height), this._dimension.width);
|
||||
} else {
|
||||
this._list.layout();
|
||||
}
|
||||
|
@ -1779,6 +1779,10 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
return this._scrollBeyondLastLine && !this.isEmbedded;
|
||||
}
|
||||
|
||||
private getBodyHeight(dimensionHeight: number) {
|
||||
return Math.max(dimensionHeight - (this._notebookTopToolbar?.useGlobalToolbar ? /** Toolbar height */ 26 : 0), 0);
|
||||
}
|
||||
|
||||
layout(dimension: DOM.Dimension, shadowElement?: HTMLElement, position?: DOM.IDomPosition): void {
|
||||
if (!shadowElement && this._shadowElementViewInfo === null) {
|
||||
this._dimension = dimension;
|
||||
|
@ -1802,7 +1806,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
|
||||
this._dimension = dimension;
|
||||
this._position = position;
|
||||
const newBodyHeight = Math.max(dimension.height - (this._notebookTopToolbar?.useGlobalToolbar ? /** Toolbar height */ 26 : 0), 0);
|
||||
const newBodyHeight = this.getBodyHeight(dimension.height);
|
||||
DOM.size(this._body, dimension.width, newBodyHeight);
|
||||
|
||||
const topInserToolbarHeight = this._notebookOptions.computeTopInsertToolbarHeight(this.viewModel?.viewType);
|
||||
|
|
Loading…
Reference in a new issue