Let themes declare that they are dark - #4354
Open
vogella wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new defaults regress legacy ID-based dark-theme behavior for existing ITheme implementations and two-argument Theme construction.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds explicit dark-theme metadata while retaining legacy ID-based detection and persisting appearance information for early startup styling.
Changes:
- Adds
isDarkThemeextension metadata andITheme.isDark(). - Uses and persists appearance metadata throughout theme selection.
- Avoids restart prompts when switching between themes of the same appearance.
File summaries
| File | Description |
|---|---|
ThemeTest.java |
Tests metadata parsing and persistence. |
plugin.xml (tests) |
Declares test themes. |
css/testTheme.css |
Supplies test stylesheet. |
build.properties |
Packages test resources. |
DefaultThemePreference.java |
Centralizes default-theme persistence. |
ViewsPreferencePage.java |
Uses appearance-aware restart behavior. |
org.eclipse.ui.themes/plugin.xml |
Marks platform dark themes explicitly. |
IDEApplication.java |
Reads persisted appearance during startup. |
ITheme.java |
Adds the appearance API. |
ThemeEngine.java |
Parses, applies, persists, and restores appearance. |
Theme.java |
Stores explicit appearance state. |
org.eclipse.e4.ui.css.swt.theme.exsd |
Documents the extension attribute. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vogella
force-pushed
the
vogella/theme-dark-attribute
branch
2 times, most recently
from
September 8, 2026 16:29
445499d to
ffbd198
Compare
BeckerWdf
reviewed
Sep 9, 2026
vogella
force-pushed
the
vogella/theme-dark-attribute
branch
from
September 9, 2026 11:31
ffbd198 to
5cd65b6
Compare
Contributor
Author
|
PR updated with the proposals, except one which was IMHO just a misunderstanding caused by wrong Javadoc, fixed now. |
BeckerWdf
approved these changes
Sep 9, 2026
The theme extension point gains an "isDarkTheme" attribute, so a theme states its appearance instead of the platform guessing it from the theme id. Themes without the attribute keep the id based classification. ThemeEngine uses ITheme.isDark() for the SWT appearance preference and when picking a dark theme to inherit the operating system setting, so a product shipping its own dark theme works too. The appearance preferences recommend a restart only when switching between light and dark. The flag is persisted next to the theme id, which lets IDEApplication style the workspace selection dialog before the theme engine exists. Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
vogella/theme-dark-attribute
branch
from
September 9, 2026 17:34
5cd65b6 to
b863876
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Themes can now declare their appearance with an
isDarkThemeattribute on the theme extension point instead of the platform guessing it from the theme id. Themes that do not set it keep the old id based classification, so existing contributions behave as before.ITheme.isDark()is added as a default method, so implementors are not broken. The theme engine uses it for the SWT appearance preference and when picking a dark theme to inherit the operating system setting, which means a product shipping its own dark theme is now handled instead of onlyorg.eclipse.e4.ui.css.theme.e4_dark. The appearance preference page only recommends a restart when the switch actually crosses between light and dark, so switching between two dark themes no longer interrupts with a dialog. The flag is persisted next to the theme id, which letsIDEApplicationstyle the workspace selection dialog from the recorded value, the only thing it has before the workbench and the theme engine exist.This supersedes #2808 by @BeckerWdf, which had the same idea and where the
isDarkThemeattribute name comes from. That PR no longer applies since the platform specific dark theme processors it patches have been removed in the meantime.