@@ -121,6 +121,7 @@ public ThemeEngine(Display display) {
121
121
String id = ce .getAttribute ("id" );
122
122
String os = ce .getAttribute ("os" );
123
123
String version = ce .getAttribute ("os_version" );
124
+ String isDarkTheme = ce .getAttribute ("isDarkTheme" );
124
125
125
126
/*
126
127
* Code to support e4 dark theme on Mac 10.13 and older. For e4 dark theme on
@@ -154,7 +155,8 @@ public ThemeEngine(Display display) {
154
155
basestylesheeturi = "platform:/plugin/" + ce .getContributor ().getName () + "/"
155
156
+ basestylesheeturi ;
156
157
}
157
- registerTheme (themeId , label , basestylesheeturi , version );
158
+
159
+ registerTheme (themeId , label , basestylesheeturi , version , isDarkTheme );
158
160
159
161
//check for modified files
160
162
if (modifiedFiles != null ) {
@@ -250,11 +252,11 @@ private boolean isOsVersionMatch(String osVersionList) {
250
252
@ Override
251
253
public synchronized ITheme registerTheme (String id , String label , String basestylesheetURI )
252
254
throws IllegalArgumentException {
253
- return registerTheme (id , label , basestylesheetURI , "" );
255
+ return registerTheme (id , label , basestylesheetURI , "" , "" );
254
256
}
255
257
256
258
public synchronized ITheme registerTheme (String id , String label ,
257
- String basestylesheetURI , String osVersion ) throws IllegalArgumentException {
259
+ String basestylesheetURI , String osVersion , String isDark ) throws IllegalArgumentException {
258
260
for (Theme t : themes ) {
259
261
if (t .getId ().equals (id )) {
260
262
throw new IllegalArgumentException ("A theme with the id '" + id
@@ -265,6 +267,9 @@ public synchronized ITheme registerTheme(String id, String label,
265
267
if (osVersion != "" ) {
266
268
theme .setOsVersion (osVersion );
267
269
}
270
+ if (isDark != "" ) {
271
+ theme .setIsDark (isDark );
272
+ }
268
273
themes .add (theme );
269
274
registerStyle (id , basestylesheetURI , false );
270
275
return theme ;
@@ -598,7 +603,7 @@ public void restore(String alternateTheme) {
598
603
}
599
604
}
600
605
601
- boolean hasDarkTheme = getThemes ().stream ().anyMatch (t -> t .getId (). startsWith ( E4_DARK_THEME_ID ));
606
+ boolean hasDarkTheme = getThemes ().stream ().anyMatch (t -> t .IsDark ( ));
602
607
boolean overrideWithDarkTheme = false ;
603
608
if (hasDarkTheme ) {
604
609
if (prefThemeId != null ) {
0 commit comments