Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2020-10-05 15:59:34 +0000
committerNiraj Modi2020-10-16 11:50:58 +0000
commit789c6a1b13e42245cdbbd222eedf92c48ee2d8cd (patch)
tree11eaf682544be71239fa581c6b8a0b0d1b5a5b2f
parent3a39b9966a7114f6866034795365b0200913e643 (diff)
downloadeclipse.platform.swt-789c6a1b13e42245cdbbd222eedf92c48ee2d8cd.tar.gz
eclipse.platform.swt-789c6a1b13e42245cdbbd222eedf92c48ee2d8cd.tar.xz
eclipse.platform.swt-789c6a1b13e42245cdbbd222eedf92c48ee2d8cd.zip
[Win32] Differentiate ReadOnly StyledText widget look similar to native ReadOnly Text.
Change-Id: Ie1b9852cb311471b1f955146a7e7ed41208178b3 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java9
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 {

Back to the top