Compute foreground and background colours for setEnabled and setEditable in StyledText#3154
Compute foreground and background colours for setEnabled and setEditable in StyledText#3154elsazac wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
8363d1c to
18583c9
Compare
67d983f to
d4c145b
Compare
|
Does this still work fine when CSS styling is used in the IDE? |
|
This is going to resolve, #230, correct? |
There was a problem hiding this comment.
Pull request overview
This PR makes StyledText apply consistent foreground/background color recomputation for both setEnabled(...) and setEditable(...), and introduces a distinct visual style for the non-editable (but enabled) state.
Changes:
- Added a shared
updateColors(enabled, editable)helper and invoked it from bothsetEnabledandsetEditable. - Introduced new system color choices for the enabled-but-non-editable state to improve visual differentiation.
- Guarded
resetCache(...)/ caret recomputation insetBackground/setForegroundwhencontentis not yet initialized.
...les/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
Outdated
Show resolved
Hide resolved
...les/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
Outdated
Show resolved
Hide resolved
...les/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
Show resolved
Hide resolved
...les/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
Outdated
Show resolved
Hide resolved
d4c145b to
e2635ea
Compare
The |
97b2bf8 to
5e13521
Compare
This commit adds the foreground and background color computation for setEditable. Earlier this was handled only for setEnabled. This commit also adds a different foreground and background color for StyledText when background is not editable. Fixes :eclipse-platform#3132
5e13521 to
c041cce
Compare
It should work as expected because there is no additional modifications that have been made differently in terms of implementation. |
|
Build looks good; |





This PR adds consistent handling of both foreground and background colors for both
setEnabledandsetEditablefunctionsThe foreground and background colors were computed only for setEnabled. This has to be done for setEditable as
well to achieve consistency. Both the functions setEditable and setEnabled now recomputes foreground and background colour (earlier only applied in
setEnabled)This commit also adds a distinct foreground and background colour combination. Earlier the editable and non-editable state showed no difference. This now improves visual differentiation in StyledText.
Test Snippet : Test.txt
The StyledText behaviour in non editable state is shown below :
Before :

After :

Fixes: #3132, Fixes: #230