Skip to content

Commit 2a5bdf2

Browse files
committed
Remove high contrast theme #3095
Fixes #3095
1 parent 47c4212 commit 2a5bdf2

File tree

4 files changed

+2
-65
lines changed

4 files changed

+2
-65
lines changed

bundles/org.eclipse.ui.themes/css/high-contrast.css

Lines changed: 0 additions & 28 deletions
This file was deleted.

bundles/org.eclipse.ui.themes/plugin.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ theme.classic = Classic
1919
theme.light = Light
2020

2121
theme.dark = Dark
22-
theme.high-contrast = High Contrast
2322

2423
#New theme element definitions
2524
DARK_BACKGROUND=Dark Background Color

bundles/org.eclipse.ui.themes/plugin.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@
5151
label="%theme.light"
5252
os="win32">
5353
</theme>
54-
<theme
55-
basestylesheeturi="css/high-contrast.css"
56-
id="org.eclipse.e4.ui.css.theme.high-contrast"
57-
label="%theme.high-contrast">
58-
</theme>
5954

6055
<themeAssociation
6156
themeId="org.eclipse.e4.ui.css.theme.e4_classic"

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ASSOCIATION;
2626
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ID;
2727

28-
import java.text.Collator;
2928
import java.util.ArrayList;
3029
import java.util.HashMap;
3130
import java.util.List;
32-
import java.util.Locale;
3331
import java.util.Map;
3432
import java.util.Objects;
3533
import org.eclipse.core.runtime.IConfigurationElement;
@@ -57,7 +55,6 @@
5755
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
5856
import org.eclipse.jface.preference.IPreferenceStore;
5957
import org.eclipse.jface.preference.PreferencePage;
60-
import org.eclipse.jface.util.Util;
6158
import org.eclipse.jface.viewers.ArrayContentProvider;
6259
import org.eclipse.jface.viewers.ComboViewer;
6360
import org.eclipse.jface.viewers.ISelection;
@@ -113,7 +110,6 @@ public class ViewsPreferencePage extends PreferencePage implements IWorkbenchPre
113110
private ControlDecoration colorFontsDecorator;
114111
private ColorsAndFontsTheme currentColorsAndFontsTheme;
115112
private Map<String, String> themeAssociations;
116-
private boolean highContrastMode;
117113

118114
private Button themingEnabled;
119115
private Button rescaleAtRuntime;
@@ -147,13 +143,11 @@ protected Control createContents(Composite parent) {
147143
comp.setLayout(layout);
148144

149145
new Label(comp, SWT.NONE).setText(WorkbenchMessages.ViewsPreferencePage_Theme);
150-
highContrastMode = parent.getDisplay().getHighContrast();
151146

152147
themeIdCombo = new ComboViewer(comp, SWT.READ_ONLY);
153148
themeIdCombo.setLabelProvider(createTextProvider(element -> ((ITheme) element).getLabel()));
154149
themeIdCombo.setContentProvider(ArrayContentProvider.getInstance());
155-
themeIdCombo.setInput(getCSSThemes(highContrastMode));
156-
themeIdCombo.getCombo().setEnabled(!highContrastMode);
150+
themeIdCombo.setInput(engine.getThemes());
157151
themeIdCombo.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
158152
this.currentTheme = engine.getActiveTheme();
159153
if (this.currentTheme != null) {
@@ -265,29 +259,6 @@ public void widgetDefaultSelected(SelectionEvent e) {
265259
parent.addSelectionListener(listener);
266260
}
267261

268-
private List<ITheme> getCSSThemes(boolean highContrastMode) {
269-
ArrayList<ITheme> themes = new ArrayList<>();
270-
for (ITheme theme : engine.getThemes()) {
271-
/*
272-
* When we have Win32 OS - when the high contrast mode is enabled on the
273-
* platform, we display the 'high-contrast' special theme only. If not, we don't
274-
* want to mess the themes combo with the theme since it is the special
275-
* variation of the 'classic' one
276-
*
277-
* When we have GTK - we have to display the entire list of the themes since we
278-
* are not able to figure out if the high contrast mode is enabled on the
279-
* platform. The user has to manually select the theme if they need it
280-
*/
281-
if (!highContrastMode && !Util.isGtk() && theme.getId().equals(E4Application.HIGH_CONTRAST_THEME_ID)) {
282-
continue;
283-
}
284-
themes.add(theme);
285-
}
286-
Collator collator = Collator.getInstance(Locale.getDefault());
287-
themes.sort((ITheme t1, ITheme t2) -> collator.compare(t1.getLabel(), t2.getLabel()));
288-
return themes;
289-
}
290-
291262
private void createColoredLabelsPref(Composite composite) {
292263
IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore();
293264

@@ -345,7 +316,7 @@ public boolean performOk() {
345316
if (engine != null) {
346317
ITheme theme = getSelectedTheme();
347318
if (theme != null) {
348-
engine.setTheme(getSelectedTheme(), !highContrastMode);
319+
engine.setTheme(getSelectedTheme(), true);
349320
}
350321
prefs.putBoolean(CTabRendering.HIDE_ICONS_FOR_VIEW_TABS, hideIconsForViewTabs.getSelection());
351322
prefs.putBoolean(CTabRendering.SHOW_FULL_TEXT_FOR_VIEW_TABS, showFullTextForViewTabs.getSelection());

0 commit comments

Comments
 (0)