Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Priya Shanmugam2019-04-26 03:45:02 -0400
committerLakshmi Shanmugam2019-04-26 04:22:22 -0400
commitb59f118ed097817ad0f30c8eedf9578e3444789f (patch)
tree8d1f8bab79c1826cf6bc57a99ea6bb614c5d5dec
parent215b2e93a351272e93bda116b9240ee541b38b83 (diff)
downloadeclipse.platform.swt-b59f118ed097817ad0f30c8eedf9578e3444789f.tar.gz
eclipse.platform.swt-b59f118ed097817ad0f30c8eedf9578e3444789f.tar.xz
eclipse.platform.swt-b59f118ed097817ad0f30c8eedf9578e3444789f.zip
Bug 540357 - [10.14] Make SWT adapt to switching to dark mode (and back)
Create system property org.eclipse.swt.display.useSystemTheme which should be set for SWT application to use the system's theme. Change-Id: I9a319b276d3dedabd6195dbf383c5a3b4c8180e7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 7f996ebb9f..cebdfb432a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -111,6 +111,8 @@ public class Display extends Device {
Dark, Light,
}
APPEARANCE appAppearance;
+ /* System property to be set for SWT application to use the system's theme */
+ static final String USE_SYSTEM_THEME = "org.eclipse.swt.display.useSystemTheme";
/* Windows and Events */
Event [] eventQueue;
@@ -2225,8 +2227,10 @@ boolean hasDefaultButton () {
protected void init () {
super.init ();
- if (OS.isSystemDarkAppearance()) {
- setAppAppearance(APPEARANCE.Dark);
+ if ("true".equalsIgnoreCase(System.getProperty(USE_SYSTEM_THEME))) {
+ if (OS.isSystemDarkAppearance()) {
+ setAppAppearance(APPEARANCE.Dark);
+ }
}
initClasses ();

Back to the top