mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
parent
d729e50521
commit
febf978c28
1 changed files with 12 additions and 4 deletions
|
@ -46,7 +46,6 @@ export abstract class Panel implements IView {
|
|||
protected _expanded: boolean;
|
||||
protected disposables: IDisposable[] = [];
|
||||
|
||||
private expandedSize: number | undefined = undefined;
|
||||
private _headerVisible = true;
|
||||
private _minimumBodySize: number;
|
||||
private _maximumBodySize: number;
|
||||
|
@ -55,6 +54,9 @@ export abstract class Panel implements IView {
|
|||
|
||||
private header: HTMLElement;
|
||||
|
||||
private cachedExpandedSize: number | undefined = undefined;
|
||||
private cachedBodySize: number | undefined = undefined;
|
||||
|
||||
private _onDidChange = new Emitter<number | undefined>();
|
||||
readonly onDidChange: Event<number | undefined> = this._onDidChange.event;
|
||||
|
||||
|
@ -129,7 +131,7 @@ export abstract class Panel implements IView {
|
|||
|
||||
this._expanded = !!expanded;
|
||||
this.updateHeader();
|
||||
this._onDidChange.fire(expanded ? this.expandedSize : undefined);
|
||||
this._onDidChange.fire(expanded ? this.cachedExpandedSize : undefined);
|
||||
}
|
||||
|
||||
get headerVisible(): boolean {
|
||||
|
@ -190,8 +192,14 @@ export abstract class Panel implements IView {
|
|||
const headerSize = this.headerVisible ? Panel.HEADER_SIZE : 0;
|
||||
|
||||
if (this.isExpanded()) {
|
||||
this.layoutBody(size - headerSize);
|
||||
this.expandedSize = size;
|
||||
const bodySize = size - headerSize;
|
||||
|
||||
if (bodySize !== this.cachedBodySize) {
|
||||
this.layoutBody(bodySize);
|
||||
this.cachedBodySize = bodySize;
|
||||
}
|
||||
|
||||
this.cachedExpandedSize = size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue