Skip to content

Commit f2c8380

Browse files
committed
feat: splash screen support for Electron
Enhances the ElectronMainApplication to optionally render a splash screen until the frontend is ready. The splash screen can be configured via the application config object "theia.frontend.config.electron.splashScreenOptions". Mandatory is the option "content" which specifies a relative path from the application root to the content of the splash screen. Optionally "width", "height", "minDuration" and "maxDuration" can be handed over too. Configures the Electron example application to show a Theia logo splash screen. Implements #13410 Contributed on behalf of Pragmatiqu IT GmbH
1 parent 8ea1846 commit f2c8380

File tree

6 files changed

+224
-9
lines changed

6 files changed

+224
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
## not yet released
88

99
- [application-package] bumped the default supported API from `1.86.2` to `1.87.2` [#13514](https://github.com/eclipse-theia/theia/pull/13514) - contributed on behalf of STMicroelectronics
10-
- [core] Fix quickpick problems found in IDE testing [#13451](https://github.com/eclipse-theia/theia/pull/13451) - contributed on behalf of STMicroelectronics
10+
- [core] Fix quickpick problems found in IDE testing [#13451](https://github.com/eclipse-theia/theia/pull/13451) - contributed on behalf of STMicroelectronics
11+
- [core] Splash Screen Support for Electron [#13505](https://github.com/eclipse-theia/theia/pull/13505) - contributed on behalf of Pragmatiqu IT GmbH
1112
- [plugin] Extend TextEditorLineNumbersStyle with Interval [#13458](https://github.com/eclipse-theia/theia/pull/13458) - contributed on behalf of STMicroelectronics
1213

1314
<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>

dev-packages/application-package/src/application-props.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,36 @@ export type ElectronFrontendApplicationConfig = RequiredRecursive<ElectronFronte
3333
export namespace ElectronFrontendApplicationConfig {
3434
export const DEFAULT: ElectronFrontendApplicationConfig = {
3535
windowOptions: {},
36-
showWindowEarly: true
36+
showWindowEarly: true,
37+
splashScreenOptions: {}
3738
};
39+
export interface SplashScreenOptions {
40+
/**
41+
* Initial width of the splash screen. Defaults to 640.
42+
*/
43+
width?: number;
44+
/**
45+
* Initial height of the splash screen. Defaults to 480.
46+
*/
47+
height?: number;
48+
/**
49+
* Minimum amount of time in milliseconds to show the splash screen before main window is shown.
50+
* Defaults to 0, i.e. the splash screen will be shown until the frontend application is ready.
51+
*/
52+
minDuration?: number;
53+
/**
54+
* Maximum amount of time in milliseconds before splash screen is removed and main window is shown.
55+
* Defaults to 30000.
56+
*/
57+
maxDuration?: number;
58+
/**
59+
* The content to load in the splash screen.
60+
* Will be resolved from application root.
61+
*
62+
* Mandatory attribute.
63+
*/
64+
content?: string;
65+
}
3866
export interface Partial {
3967

4068
/**
@@ -50,6 +78,13 @@ export namespace ElectronFrontendApplicationConfig {
5078
* Defaults to `true`.
5179
*/
5280
readonly showWindowEarly?: boolean;
81+
82+
/**
83+
* Configuration options for splash screen.
84+
*
85+
* Defaults to `{}` which results in no splash screen being displayed.
86+
*/
87+
readonly splashScreenOptions?: SplashScreenOptions;
5388
}
5489
}
5590

examples/electron/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
"frontend": {
1111
"config": {
1212
"applicationName": "Theia Electron Example",
13-
"reloadOnReconnect": true
13+
"reloadOnReconnect": true,
14+
"electron": {
15+
"splashScreenOptions": {
16+
"content": "resources/theia-logo.svg",
17+
"height": 90
18+
}
19+
}
1420
}
1521
},
1622
"backend": {
Lines changed: 32 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)