Merge pull request #434 from mathuo/361-full-screen-mode-for-a-single-tab

feat: do not persist maximized view state
This commit is contained in:
mathuo 2024-01-10 13:10:13 +00:00 committed by GitHub
commit 0b67d8e50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,6 +393,14 @@ export class Gridview implements IDisposable {
}
public serialize(): SerializedGridview<any> {
if (this.hasMaximizedView()) {
/**
* do not persist maximized view state but we must first exit any maximized views
* before serialization to ensure the correct dimensions are persisted
*/
this.exitMaximizedView();
}
const root = serializeBranchNode(this.getView(), this.orientation);
return {
@ -423,10 +431,14 @@ export class Gridview implements IDisposable {
);
}
public deserialize(json: any, deserializer: IViewDeserializer): void {
public deserialize<T>(
json: SerializedGridview<T>,
deserializer: IViewDeserializer
): void {
const orientation = json.orientation;
const height =
orientation === Orientation.VERTICAL ? json.height : json.width;
this._deserialize(
json.root as ISerializedBranchNode,
orientation,