Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.swt;bundle-version="[3.133.0,4.0.0)",
Require-Bundle: org.eclipse.swt;bundle-version="[3.134.0,4.0.0)",
org.eclipse.e4.ui.css.swt;bundle-version="0.13.100",
org.eclipse.e4.ui.css.core;bundle-version="0.12.200",
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ public void setTheme(ITheme theme, boolean restore, boolean force) {
ThemeEngineManager.logError(e.getMessage(), e);
}
}
boolean isDark = theme.getId().contains("dark"); //$NON-NLS-1$
display.setDarkThemePreferred(isDark);

sendThemeChangeEvent(restore);

for (CSSEngine engine : cssEngines) {
Expand Down
6 changes: 1 addition & 5 deletions bundles/org.eclipse.e4.ui.swt.gtk/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %fragmentName
Bundle-SymbolicName: org.eclipse.e4.ui.swt.gtk;singleton:=true
Bundle-Version: 1.2.200.qualifier
Bundle-Version: 1.2.300.qualifier
Fragment-Host: org.eclipse.e4.ui.css.swt.theme;bundle-version="0.10.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment-gtk
Bundle-Vendor: %providerName
Eclipse-PlatformFilter: (osgi.ws=gtk)
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)",
org.eclipse.e4.core.services.events,
org.osgi.service.event;version="1.3.1"
Automatic-Module-Name: org.eclipse.e4.ui.swt.gtk
8 changes: 0 additions & 8 deletions bundles/org.eclipse.e4.ui.swt.gtk/fragment.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<fragment>
<extension id="org.eclipse.e4.ui.swt.gtk.processor"
point="org.eclipse.e4.workbench.model">
<processor
apply="always"
beforefragment="true"
class="org.eclipse.e4.ui.swt.internal.gtk.DarkThemeProcessor">
</processor>
</extension>

</fragment>

This file was deleted.

6 changes: 1 addition & 5 deletions bundles/org.eclipse.e4.ui.swt.win32/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %fragmentName
Bundle-SymbolicName: org.eclipse.e4.ui.swt.win32;singleton:=true
Bundle-Version: 1.2.300.qualifier
Bundle-Version: 1.2.400.qualifier
Fragment-Host: org.eclipse.e4.ui.css.swt.theme;bundle-version="0.10.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment-win32
Bundle-Vendor: %providerName
Eclipse-PlatformFilter: (osgi.ws=win32)
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)",
org.eclipse.e4.core.services.events,
org.osgi.service.event;version="[1.3.0,2.0.0)"
Automatic-Module-Name: org.eclipse.e4.ui.swt.win32
8 changes: 0 additions & 8 deletions bundles/org.eclipse.e4.ui.swt.win32/fragment.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<fragment>
<extension id="org.eclipse.e4.ui.swt.win32.processor"
point="org.eclipse.e4.workbench.model">
<processor
apply="always"
beforefragment="true"
class="org.eclipse.e4.ui.swt.internal.win32.DarkThemeProcessor">
</processor>
</extension>

</fragment>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Eclipse-PlatformFilter: (osgi.ws=cocoa)
Bundle-SymbolicName: org.eclipse.e4.ui.workbench.renderers.swt.cocoa;singleton:=true
Bundle-Version: 0.14.600.qualifier
Bundle-Version: 0.14.700.qualifier
Bundle-Name: %fragmentName
Bundle-Vendor: %providerName
Fragment-Host: org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="[0.10.0,1.0.0)"
Require-Bundle: org.eclipse.e4.ui.css.swt.theme
Bundle-Localization: fragment-cocoa
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.eclipse.e4.ui.workbench.renderers.swt.cocoa;x-internal:=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,5 @@
class="org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIProcessor">
</processor>
</extension>
<extension
id="CocoaDarkThemeProcessor"
name="Cocoa Dark Theme Processor"
point="org.eclipse.e4.workbench.model">
<processor
apply="always"
beforefragment="false"
class="org.eclipse.e4.ui.swt.internal.cocoa.CocoaDarkThemeProcessor">
</processor>
</extension>

</fragment>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.UserScope;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.jface.dialogs.IDialogConstants;
Expand Down Expand Up @@ -94,6 +97,7 @@ public class IDEApplication implements IApplication, IExecutableExtension {

private static final String USER_NAME = "user.name"; //$NON-NLS-1$


// Use the branding plug-in of the platform feature since this is most likely
// to change on an update of the IDE.
private static final String WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME = "org.eclipse.platform"; //$NON-NLS-1$
Expand Down Expand Up @@ -145,6 +149,9 @@ public Object start(IApplicationContext appContext) throws Exception {
Job.getJobManager().suspend();

Display display = createDisplay();

initializeDefaultTheme(display);

// processor must be created before we start event loop
DelayedEventsProcessor processor = new DelayedEventsProcessor(display);

Expand Down Expand Up @@ -586,7 +593,6 @@ protected Shell getParentShell() {
// in the task manager of the OS
return null;
}

}.prompt(force);
}

Expand Down Expand Up @@ -852,6 +858,28 @@ protected static Version toMajorMinorVersion(Version version) {
return new Version(version.getMajor(), version.getMinor(), 0);
}

protected void initializeDefaultTheme(Display display) {
IEclipsePreferences themeNode = UserScope.INSTANCE
.getNode("org.eclipse.e4.ui.css.swt.theme"); //$NON-NLS-1$
String productOrAppId = getProductOrApplicationId();
String defaultThemeId = null;
if (productOrAppId != null) {
defaultThemeId = themeNode.node(productOrAppId).get("themeid", null); //$NON-NLS-1$
}
boolean isDark = defaultThemeId != null && defaultThemeId.contains("dark"); //$NON-NLS-1$
if (isDark) {
display.setDarkThemePreferred(true);
}
}

private static String getProductOrApplicationId() {
IProduct product = Platform.getProduct();
if (product != null) {
return product.getId();
}
return System.getProperty("eclipse.application"); //$NON-NLS-1$
}

@Override
public void stop() {
final IWorkbench workbench = PlatformUI.getWorkbench();
Expand All @@ -865,4 +893,4 @@ public void stop() {
}
});
}
}
}
Loading