@@ -13,6 +13,9 @@ const {
13
13
const {
14
14
ApplicationProps,
15
15
} = require ( '@theia/application-package/lib/application-props' ) ;
16
+ const {
17
+ FrontendApplicationConfigProvider,
18
+ } = require ( '@theia/core/lib/browser/frontend-application-config-provider' ) ;
16
19
17
20
const lightTheme = 'arduino-theme' ;
18
21
const darkTheme = 'arduino-theme-dark' ;
@@ -21,22 +24,28 @@ const defaultTheme =
21
24
? darkTheme
22
25
: lightTheme ;
23
26
27
+ const originalGet = FrontendApplicationConfigProvider . get ;
28
+ FrontendApplicationConfigProvider . get = function ( ) {
29
+ const originalProps = originalGet . bind ( FrontendApplicationConfigProvider ) ( ) ;
30
+ return { ...originalProps , defaultTheme } ;
31
+ } . bind ( FrontendApplicationConfigProvider ) ;
32
+
24
33
const arduinoDarkTheme = {
25
34
id : 'arduino-theme-dark' ,
26
35
type : 'dark' ,
27
36
label : 'Dark (Arduino)' ,
28
37
editorTheme : 'arduino-theme-dark' ,
29
- activate ( ) { } ,
30
- deactivate ( ) { }
38
+ activate ( ) { } ,
39
+ deactivate ( ) { } ,
31
40
} ;
32
41
33
42
const arduinoLightTheme = {
34
43
id : 'arduino-theme' ,
35
44
type : 'light' ,
36
45
label : 'Light (Arduino)' ,
37
46
editorTheme : 'arduino-theme' ,
38
- activate ( ) { } ,
39
- deactivate ( ) { }
47
+ activate ( ) { } ,
48
+ deactivate ( ) { } ,
40
49
} ;
41
50
42
51
if ( ! window [ ThemeServiceSymbol ] ) {
@@ -49,7 +58,11 @@ if (!window[ThemeServiceSymbol]) {
49
58
) ;
50
59
} ,
51
60
} ) ;
52
- themeService . register ( ...BuiltinThemeProvider . themes , arduinoDarkTheme , arduinoLightTheme ) ;
61
+ themeService . register (
62
+ ...BuiltinThemeProvider . themes ,
63
+ arduinoDarkTheme ,
64
+ arduinoLightTheme
65
+ ) ;
53
66
themeService . startupTheme ( ) ;
54
67
themeService . setCurrentTheme ( defaultTheme ) ;
55
68
window [ ThemeServiceSymbol ] = themeService ;
0 commit comments