Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2022-03-10 05:47:36 +0000
committerNiraj Modi2022-03-10 10:56:13 +0000
commit48420836338153cbc1ee81d150bb78ffdb496616 (patch)
treecb210a56429624413ebf1d94af7f8c7e60a04b68
parent590de8b87184a6d6a61bd082650a2ed6ee5e905c (diff)
downloadeclipse.platform.ui-48420836338153cbc1ee81d150bb78ffdb496616.tar.gz
eclipse.platform.ui-48420836338153cbc1ee81d150bb78ffdb496616.tar.xz
eclipse.platform.ui-48420836338153cbc1ee81d150bb78ffdb496616.zip
Bug 567563 - [Win32] Eclipse could set dark mode based on os settings.
- Removed the OS check for MAC and GTK platforms. - Fixed bundle version in project: org.eclipse.e4.ui.workbench.renderers.swt Change-Id: I4632f1279b830d71bbb4d153d7f129238652a5b2 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/191693 Tested-by: Platform Bot <platform-bot@eclipse.org>
-rw-r--r--bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java16
2 files changed, 8 insertions, 10 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF
index 32d93a3efbb..346420b4626 100644
--- a/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.css.swt.theme/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.ui.css.swt.theme;singleton:=true
-Bundle-Version: 0.13.0.qualifier
+Bundle-Version: 0.13.100.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java b/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java
index 5de36abbf7d..5019d7be603 100644
--- a/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java
+++ b/bundles/org.eclipse.e4.ui.css.swt.theme/src/org/eclipse/e4/ui/css/swt/internal/theme/ThemeEngine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2018 Tom Schindl and others.
+ * Copyright (c) 2010, 2022 Tom Schindl and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -609,15 +609,13 @@ public class ThemeEngine implements IThemeEngine {
}
}
- // For Mac & GTK, if the system has Dark appearance set and Eclipse is using the
- // default settings, then start Eclipse in Dark theme.
-
- // Check that there is a dark theme present
+ /*
+ * Any Platform: if the system has Dark appearance set and Eclipse is using the
+ * default settings, then start Eclipse in Dark theme. Check that there is a
+ * dark theme present.
+ */
boolean hasDarkTheme = getThemes().stream().anyMatch(t -> t.getId().startsWith(E4_DARK_THEME_ID));
-
- String os = Platform.getOS();
- String themeToRestore = (Platform.OS_LINUX.equals(os) || Platform.OS_MACOSX.equals(os))
- && Display.isSystemDarkTheme() && hasDarkTheme ? E4_DARK_THEME_ID : alternateTheme;
+ String themeToRestore = Display.isSystemDarkTheme() && hasDarkTheme ? E4_DARK_THEME_ID : alternateTheme;
if (themeToRestore != null && flag) {
setTheme(themeToRestore, false);
}

Back to the top