File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,12 @@ public String getOsVersion() {
4646
4747 @ Override
4848 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+ }
5055 }
5156
5257 public void setIsDark (String isDark ) {
Original file line number Diff line number Diff line change @@ -567,8 +567,8 @@ private String getPreferenceThemeId() {
567567 return getPreferences ().get (THEMEID_KEY , null );
568568 }
569569
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 );
572572 }
573573
574574 private IEclipsePreferences getPreferences () {
@@ -618,7 +618,7 @@ public void restore(String alternateTheme) {
618618 * this case want to fall back to respect whether that previous choice was dark
619619 * or not. https://github.com/eclipse-platform/eclipse.platform.ui/issues/2776
620620 */
621- overrideWithDarkTheme = getPreferenceThemeIsDark ();
621+ overrideWithDarkTheme = getPreferenceThemeIsDark (prefThemeId . contains ( "dark" ) );
622622 } else {
623623 /*
624624 * 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