diff options
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 6bd08bb92d..c08f21a8b3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8933,12 +8933,15 @@ public void setEnabled(boolean enabled) { this.enabled = enabled; this.insideSetEnableCall = true; try { - if (enabled) { + if (enabled && editable) { if (!customBackground) setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); if (!customForeground) setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND)); - } else { + } else if(!enabled) { if (!customBackground) setBackground(display.getSystemColor(SWT.COLOR_TEXT_DISABLED_BACKGROUND)); if (!customForeground) setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DISABLED_FOREGROUND)); + } else if(!editable) { + if (!customBackground) setBackground(display.getSystemColor(SWT.COLOR_TEXT_DISABLED_BACKGROUND)); + if (!customForeground) setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND)); } } finally { |