Use new SWT Display.setDarkThemePreferred() API for dark theme#3874
Draft
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
Draft
Use new SWT Display.setDarkThemePreferred() API for dark theme#3874vogella wants to merge 3 commits intoeclipse-platform:masterfrom
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
Conversation
Replace platform-specific dark theme processors (Win32, GTK, Cocoa) with the new cross-platform SWT API Display.setDarkThemePreferred(boolean). The ThemeEngine now calls display.setDarkThemePreferred() directly when a theme is set, signaling the dark mode preference to the OS for native components like title bars, scrollbars, and native dialogs. In IDEApplication, the manual dark styling (hardcoded colors, SWT.Show listeners, recursive style application) is replaced with a single call to display.setDarkThemePreferred(true) during early startup. Dark theme processor code removed from: - org.eclipse.e4.ui.swt.win32 (DarkThemeProcessor using OS.setTheme) - org.eclipse.e4.ui.swt.gtk (DarkThemeProcessor using OS.setDarkThemePreferred) - org.eclipse.e4.ui.workbench.renderers.swt.cocoa (CocoaDarkThemeProcessor using OS.setTheme) The bundles themselves are kept for later retirement. Fixes eclipse-platform#3857
Contributor
Contributor
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
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.
Summary
Replace platform-specific dark theme processors (Win32, GTK, Cocoa) with the new cross-platform SWT API
Display.setDarkThemePreferred(boolean)from eclipse-platform/eclipse.platform.swt#3184.Changes
ThemeEngine (cross-platform)
display.setDarkThemePreferred(isDark)directly insetTheme(), signaling the OS dark mode preference whenever the CSS theme changes.[3.134.0,4.0.0)for the new API.IDEApplication (startup simplification)
SWT.Showlisteners, recursive style application on splash/workspace dialog) with a singledisplay.setDarkThemePreferred(true)call during early startup.applyDarkStyles(),applyStylesRecursive(), and theisDarkfield.Removed dark theme processor code from (bundles kept for later retirement):
DarkThemeProcessorusing internalOS.setTheme()DarkThemeProcessorusing internalOS.setDarkThemePreferred()CocoaDarkThemeProcessorusing internalOS.setTheme()Cleaned up
MANIFEST.MFimports,fragment.xmlextensions, and removed the now-unnecessaryRequire-Bundleonorg.eclipse.e4.ui.css.swt.themefrom the cocoa bundle.Note
Fixes #3857