Bug 559093 - [JFace] Completion proposal popup foreground color can be wrong
Summary: [JFace] Completion proposal popup foreground color can be wrong
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 4.15 M3   Edit
Assignee: Ralf Heydenreich CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2020-01-13 03:52 EST by Ralf Heydenreich CLA
Modified: 2020-01-20 05:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Heydenreich CLA 2020-01-13 03:52:56 EST
In method org.eclipse.jface.text.contentassist.CompletionProposalPopup#createProposalSelector() there seems to be a C&P mistake (l. 682-690):

{code}
Color background= getBackgroundColor(control);
if (background == null) {
   background= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
}

Color foreground= getForegroundColor(control);
if (foreground == null) {
	foreground= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
}
{code}
I think the foreground color should come from JFaceColors.getInformationViewerForegroundColor
Comment 1 Paul Pazderski CLA 2020-01-13 04:04:53 EST
Yes, seems fishy. Same for CompletionProposalPopup2. Do you like to provide a change yourself [1] or is it not worth the setup for you?

I'm also interested how you found it. It seems to be rare that fore- and background are retrieved from JFaceColors if no one had reported such unreadable result yet.

[1] https://wiki.eclipse.org/Platform/How_to_Contribute
Comment 2 Ralf Heydenreich CLA 2020-01-13 04:20:25 EST
I'll try to contribute a patch (but could take some time). 
I found the bug while proving the migration of Xtext to a pure E4 base. For this I've created a little example project with a very pure Xtext implementation. While showing the autocompletion the error occured.
Comment 3 Paul Pazderski CLA 2020-01-13 04:26:01 EST
(In reply to Ralf Heydenreich from comment #2)
> I'll try to contribute a patch (but could take some time). 
No problem. Feel free to ask if you want any help.
Comment 4 Eclipse Genie CLA 2020-01-19 07:57:49 EST
New Gerrit change created: https://git.eclipse.org/r/156145
Comment 6 Andrey Loskutov CLA 2020-01-20 05:16:39 EST
Thanks Ralf!