Use UserScope instead of ConfigurationScope for default theme#3875
Conversation
The default theme preference is now stored in user scope instead of configuration scope. UserScope is more appropriate as it represents a per-user setting that should roam with the user across installations, while ConfigurationScope is shared across all users of an installation.
|
So all different rcp and ide applications and all installations of those can only have one theme and there is no possibility to specify otherwise? Is that really a good idea? It seems like a loss of flexibility and a source of conflicting needs doesn’t it? |
No, the override is possible per workspace, this has not changed. |
Could you elaborate how this override works? Changed code seem to use only user scope? |
|
The logic to use either a workspace specific theme or a default theme was added in 75599e0 During theme switch the user can now set the selected theme as default This setting is saved as configuration scope and loaded for new workspaces unless the user has a theme set for this specific workspace. Add 'Use as default theme' checkbox to theme restart dialog And on commit a7e91a0 which introduced the default theme feature but I assume that was clear as it was in the PR description, |
Imagine being on vacation getting 100 emails about all kinds of changes. After a while I think things are only clear to the email generators, which seem to produce higher volume with ever increasing frequency on so many different themes it feels like being on a freeway with oncoming traffic. It still feels like having a theme preference shared across all different applications is not necessarily ideal, but I suppose users affected could choose not to use it, though it’s not as if one could unset the default once set. I just imagined that different products/applications could choose different defaults. I was not aware a default was not possible previously. I thought products could specify default. Hard to investigate from an iPhone. |
|
@merks to give the full picture in short words: Current situation: Theme can be set by workspace and via product customization (second one I guess, never used it). New situation: During theme switch user can decide that the selected theme becomes the default theme for workspaces without an explicit theme set. Preference has a way to set or remove the default via a button (will be in tomorrows I-build) beside the theme selection.
Examples: 10 workspace never set a theme, user selects dark theme as default -> all go dark |
|
In principle it has useful aspects, but I keep mentioning all kinds of diverse eclipse applications and your answers always sound like talking about the eclipse IDE. |
There was a problem hiding this comment.
Pull request overview
This PR changes where the “default theme” preference is persisted and read, moving it from a shared installation-level scope (ConfigurationScope) to a per-user scope (UserScope) so the setting is user-specific and can roam with the user.
Changes:
- Persist the chosen default theme ID into
UserScopefrom the Views preference page. - Read the default theme ID from
UserScopeduring workbench startup when no explicit theme argument/URI is provided.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java | Writes the “use as default” theme selection to UserScope instead of ConfigurationScope. |
| bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java | Reads the default theme from UserScope instead of ConfigurationScope when no theme is provided via args/URI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| IEclipsePreferences userScopeNode = UserScope.INSTANCE | ||
| .getNode("org.eclipse.e4.ui.css.swt.theme"); | ||
| String defaultThemeId = configurationScopeNode.get("themeid", DEFAULT_THEME_ID); | ||
| String defaultThemeId = userScopeNode.get("themeid", DEFAULT_THEME_ID); | ||
| context.set(E4Application.THEME_ID, defaultThemeId); |
There was a problem hiding this comment.
Switching the default theme preference from ConfigurationScope to UserScope will cause existing installations that already stored themeid in ConfigurationScope to silently fall back to DEFAULT_THEME_ID until the user re-saves the preference. Consider reading from UserScope first and falling back to ConfigurationScope when the key is absent (and optionally migrating/copying the value into UserScope) to preserve backwards compatibility.
|
Copilot suggest to add migration code, as this feature was only implemented yesterday I merge it now to avoid this migration need. |
Ah, I did not see that comment. Must be the 100 email issue you mentioned. I think that is a valid concern. While the user may want to use the same theme for his Java IDE he may use a different theme for the C++ IDE. Shall this theme default set by product or application? |
Per product is probably better since it reflects the 'branding' and users might not know that the product/app they are using is based on Eclipse. |


Changes the default theme preference storage from ConfigurationScope to UserScope.
UserScope is more appropriate as it represents a per-user setting that roams with the user across installations, while ConfigurationScope is shared across all users of an installation.
Changes
Based on commit a7e91a0 which introduced the default theme feature.