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 970658a7e4c..3d5ba0cb66f 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 @@ -588,13 +588,11 @@ public void restore(String alternateTheme) { prefThemeId = "org.eclipse.e4.ui.css.theme.e4_classic"; //$NON-NLS-1$ } - boolean flag = true; if (prefThemeId != null) { for (ITheme t : getThemes()) { if (prefThemeId.equals(t.getId())) { setTheme(t, false); - flag = false; - break; + return; } } } @@ -608,7 +606,7 @@ public void restore(String alternateTheme) { boolean disableOSDarkThemeInherit = "true".equalsIgnoreCase(System.getProperty(DISABLE_OS_DARK_THEME_INHERIT)); boolean overrideWithDarkTheme = Display.isSystemDarkTheme() && hasDarkTheme && !disableOSDarkThemeInherit; String themeToRestore = overrideWithDarkTheme ? E4_DARK_THEME_ID : alternateTheme; - if (themeToRestore != null && flag) { + if (themeToRestore != null) { setTheme(themeToRestore, false); } }