File tree 2 files changed +9
-4
lines changed
bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,12 @@ public String getOsVersion() {
46
46
47
47
@ Override
48
48
public boolean isDark () {
49
- return Boolean .parseBoolean (isDark );
49
+ if (isDark == null ) {
50
+ // fallback for themes that don't yet set the "isDark" attribute
51
+ return id .contains ("dark" );
52
+ } else {
53
+ return Boolean .parseBoolean (isDark );
54
+ }
50
55
}
51
56
52
57
public void setIsDark (String isDark ) {
Original file line number Diff line number Diff line change @@ -567,8 +567,8 @@ private String getPreferenceThemeId() {
567
567
return getPreferences ().get (THEMEID_KEY , null );
568
568
}
569
569
570
- private boolean getPreferenceThemeIsDark () {
571
- return getPreferences ().getBoolean (THEME_IS_DARK_KEY , false );
570
+ private boolean getPreferenceThemeIsDark (boolean fallback ) {
571
+ return getPreferences ().getBoolean (THEME_IS_DARK_KEY , fallback );
572
572
}
573
573
574
574
private IEclipsePreferences getPreferences () {
@@ -618,7 +618,7 @@ public void restore(String alternateTheme) {
618
618
* this case want to fall back to respect whether that previous choice was dark
619
619
* or not. https://github.com/eclipse-platform/eclipse.platform.ui/issues/2776
620
620
*/
621
- overrideWithDarkTheme = getPreferenceThemeIsDark ();
621
+ overrideWithDarkTheme = getPreferenceThemeIsDark (prefThemeId . contains ( "dark" ) );
622
622
} else {
623
623
/*
624
624
* No previous theme selection in preferences. In this case check if the system
You can’t perform that action at this time.
0 commit comments