Skip to content

Commit

Permalink
Dark theme inheritance override was a bit too much. #185
Browse files Browse the repository at this point in the history
- It would disable restoring the theme, even if not dark theme.
- Now only overrides the decision to inherit dark theme.
  • Loading branch information
dhendriks authored and akurtakov committed Sep 6, 2022
1 parent f7af9f0 commit 6953c7d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,10 @@ public void restore(String alternateTheme) {
* dark theme present. Can be disabled using a system property.
*/
boolean hasDarkTheme = getThemes().stream().anyMatch(t -> t.getId().startsWith(E4_DARK_THEME_ID));
String themeToRestore = Display.isSystemDarkTheme() && hasDarkTheme ? E4_DARK_THEME_ID : alternateTheme;
boolean disableOSDarkThemeInherit = "true".equalsIgnoreCase(System.getProperty(DISABLE_OS_DARK_THEME_INHERIT));
if (themeToRestore != null && flag && !disableOSDarkThemeInherit) {
boolean overrideWithDarkTheme = Display.isSystemDarkTheme() && hasDarkTheme && !disableOSDarkThemeInherit;
String themeToRestore = overrideWithDarkTheme ? E4_DARK_THEME_ID : alternateTheme;
if (themeToRestore != null && flag) {
setTheme(themeToRestore, false);
}
}
Expand Down

0 comments on commit 6953c7d

Please sign in to comment.