@@ -13,6 +13,9 @@ const {
1313const {
1414 ApplicationProps,
1515} = require ( '@theia/application-package/lib/application-props' ) ;
16+ const {
17+ FrontendApplicationConfigProvider,
18+ } = require ( '@theia/core/lib/browser/frontend-application-config-provider' ) ;
1619
1720const lightTheme = 'arduino-theme' ;
1821const darkTheme = 'arduino-theme-dark' ;
@@ -21,22 +24,28 @@ const defaultTheme =
2124 ? darkTheme
2225 : lightTheme ;
2326
27+ const originalGet = FrontendApplicationConfigProvider . get ;
28+ FrontendApplicationConfigProvider . get = function ( ) {
29+ const originalProps = originalGet . bind ( FrontendApplicationConfigProvider ) ( ) ;
30+ return { ...originalProps , defaultTheme } ;
31+ } . bind ( FrontendApplicationConfigProvider ) ;
32+
2433const arduinoDarkTheme = {
2534 id : 'arduino-theme-dark' ,
2635 type : 'dark' ,
2736 label : 'Dark (Arduino)' ,
2837 editorTheme : 'arduino-theme-dark' ,
29- activate ( ) { } ,
30- deactivate ( ) { }
38+ activate ( ) { } ,
39+ deactivate ( ) { } ,
3140} ;
3241
3342const arduinoLightTheme = {
3443 id : 'arduino-theme' ,
3544 type : 'light' ,
3645 label : 'Light (Arduino)' ,
3746 editorTheme : 'arduino-theme' ,
38- activate ( ) { } ,
39- deactivate ( ) { }
47+ activate ( ) { } ,
48+ deactivate ( ) { } ,
4049} ;
4150
4251if ( ! window [ ThemeServiceSymbol ] ) {
@@ -49,7 +58,11 @@ if (!window[ThemeServiceSymbol]) {
4958 ) ;
5059 } ,
5160 } ) ;
52- themeService . register ( ...BuiltinThemeProvider . themes , arduinoDarkTheme , arduinoLightTheme ) ;
61+ themeService . register (
62+ ...BuiltinThemeProvider . themes ,
63+ arduinoDarkTheme ,
64+ arduinoLightTheme
65+ ) ;
5366 themeService . startupTheme ( ) ;
5467 themeService . setCurrentTheme ( defaultTheme ) ;
5568 window [ ThemeServiceSymbol ] = themeService ;
0 commit comments