You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Respect user light/dark preference when restoring nonexistent theme
When restoring a theme from preferences, which does not exist anymore.
we previously fell back to inherting from the operating system.
However, when when the user actively set the Eclipse theme to not match
the light/dark mode of the OS, we would then fall back again to
inheritance and override the user's choice.
To improve this, we look at the preference the user had actively chosen
before and see whether that was a dark theme or not and decide on that
which theme to fall back to.
Note: To check whether the theme is light or dark, we use the same
heuristic also used in other places, themeId.contains("dark"):
- org.eclipse.e4.ui.swt.internal.gtk.DarkThemeProcessor
- org.eclipse.e4.ui.swt.internal.win32.DarkThemeProcessor
- org.eclipse.e4.ui.swt.internal.cocoa.CocoaDarkThemeProcessor
Future improvements to consider, out of scope for this change:
- Move the heuristic themeId.contains("dark") to central place
and to re-use
- Even better, add an explicit "isDark" flag / preference somewhere
- On top of that, use a mode=dark/light/followSystem instead, see
also #2440.
0 commit comments