提交 6e92e3ac 编写于 作者: J Joao Moreno

Revert "cache panel body size"

This reverts commit febf978c.

fixes #61450
上级 349e31fe
...@@ -46,6 +46,7 @@ export abstract class Panel implements IView { ...@@ -46,6 +46,7 @@ export abstract class Panel implements IView {
protected _expanded: boolean; protected _expanded: boolean;
protected disposables: IDisposable[] = []; protected disposables: IDisposable[] = [];
private expandedSize: number | undefined = undefined;
private _headerVisible = true; private _headerVisible = true;
private _minimumBodySize: number; private _minimumBodySize: number;
private _maximumBodySize: number; private _maximumBodySize: number;
...@@ -54,9 +55,6 @@ export abstract class Panel implements IView { ...@@ -54,9 +55,6 @@ export abstract class Panel implements IView {
private header: HTMLElement; private header: HTMLElement;
private cachedExpandedSize: number | undefined = undefined;
private cachedBodySize: number | undefined = undefined;
private _onDidChange = new Emitter<number | undefined>(); private _onDidChange = new Emitter<number | undefined>();
readonly onDidChange: Event<number | undefined> = this._onDidChange.event; readonly onDidChange: Event<number | undefined> = this._onDidChange.event;
...@@ -131,7 +129,7 @@ export abstract class Panel implements IView { ...@@ -131,7 +129,7 @@ export abstract class Panel implements IView {
this._expanded = !!expanded; this._expanded = !!expanded;
this.updateHeader(); this.updateHeader();
this._onDidChange.fire(expanded ? this.cachedExpandedSize : undefined); this._onDidChange.fire(expanded ? this.expandedSize : undefined);
} }
get headerVisible(): boolean { get headerVisible(): boolean {
...@@ -192,14 +190,8 @@ export abstract class Panel implements IView { ...@@ -192,14 +190,8 @@ export abstract class Panel implements IView {
const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0; const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0;
if (this.isExpanded()) { if (this.isExpanded()) {
const bodySize = size - headerSize; this.layoutBody(size - headerSize);
this.expandedSize = size;
if (bodySize !== this.cachedBodySize) {
this.layoutBody(bodySize);
this.cachedBodySize = bodySize;
}
this.cachedExpandedSize = size;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册