Skip to content

Commit

Permalink
Ensure ApplicationShellOptions are properly used for shell init (#12983)
Browse files Browse the repository at this point in the history
Fixes #12982
  • Loading branch information
martin-fleck-at authored Oct 11, 2023
1 parent e32a0f3 commit f1056b3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions packages/core/src/browser/shell/application-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,22 @@ export class ApplicationShell extends Widget {
@inject(SecondaryWindowHandler) protected readonly secondaryWindowHandler: SecondaryWindowHandler,
) {
super(options as Widget.IOptions);

// Merge the user-defined application options with the default options
this.options = {
bottomPanel: {
...ApplicationShell.DEFAULT_OPTIONS.bottomPanel,
...options?.bottomPanel || {}
},
leftPanel: {
...ApplicationShell.DEFAULT_OPTIONS.leftPanel,
...options?.leftPanel || {}
},
rightPanel: {
...ApplicationShell.DEFAULT_OPTIONS.rightPanel,
...options?.rightPanel || {}
}
};
}

@postConstruct()
Expand Down Expand Up @@ -303,21 +319,6 @@ export class ApplicationShell extends Widget {
protected initializeShell(): void {
this.addClass(APPLICATION_SHELL_CLASS);
this.id = 'theia-app-shell';
// Merge the user-defined application options with the default options
this.options = {
bottomPanel: {
...ApplicationShell.DEFAULT_OPTIONS.bottomPanel,
...this.options?.bottomPanel || {}
},
leftPanel: {
...ApplicationShell.DEFAULT_OPTIONS.leftPanel,
...this.options?.leftPanel || {}
},
rightPanel: {
...ApplicationShell.DEFAULT_OPTIONS.rightPanel,
...this.options?.rightPanel || {}
}
};

this.mainPanel = this.createMainPanel();
this.topPanel = this.createTopPanel();
Expand Down

0 comments on commit f1056b3

Please sign in to comment.