Bug 483225 - Content assist top choice selection background and foreground colors are unreadable / Not settable
Summary: Content assist top choice selection background and foreground colors are unre...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-29 02:46 EST by patrick adams CLA
Modified: 2019-09-13 07:32 EDT (History)
7 users (show)

See Also:


Attachments
Screen Shot showing the colors in CDT (31.89 KB, image/png)
2015-11-29 02:46 EST, patrick adams CLA
no flags Details
selected no focused line in list is unreadable (111.65 KB, image/png)
2018-05-04 10:41 EDT, ja GeniuZ CLA
no flags Details
Content assist classic theme (54.01 KB, image/png)
2019-09-13 07:23 EDT, Grégory OLIVER CLA
no flags Details
content assist on aero (58.08 KB, image/png)
2019-09-13 07:24 EDT, Grégory OLIVER CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description patrick adams CLA 2015-11-29 02:46:15 EST
Created attachment 258335 [details]
Screen Shot showing the colors in CDT

The color for background and foreground on the selected item in content assist is not editable.

The color choice is very light gray on white. and is nearly unreadable.

I tested this in CDT and PDT,  both have the same colors.

I attempted to apply fixes to 
/usr/share/themes/Adwaita/gtk-2.0/gtkrc eclipse
/home/username/.gtkrc-eclipse (With path change)

====== Adwaita/gtk-2.0/gtkrc ======
style "tooltips"
{
    xthickness	= 8
    ythickness	= 4

    bg[NORMAL]	  = @tooltip_bg_color
    fg[NORMAL]	  = @tooltip_fg_color
    bg[SELECTED]  = @tooltip_bg_color
}

style "eclipse-tooltips"
{
    xthickness	= 8
    ythickness	= 4

    bg[NORMAL]	  = "#313739" #I have tried several combinations, No effect.
    fg[NORMAL]	  = "#ededed"
    bg[SELECTED]  = "#313739"
}
============================

====== .gtkrc-eclipse ======
style "eclipse" {
        font_name = "Sans Condensed 8"
}

style "listitem"  {
        base[ACTIVE] = "#AAAAAA"
}

class "GtkWidget" style "eclipse"
class "GtkTreeView" style "listitem"
============================

changing content assist colors in ...

Preferences > General > Editors > Text Editors
Preferences > General > appearance > colors and fonts > basic > Content Assist (changing between black , white, and gray for both with no effect.)

I have also tried (changing around several other colors specific to CDT and PDT, with no effect.  So i believe it is not a problem with those 2 packages.




Even if it was fixable via a gtkrc edit.   This needs to be changeable in eclipse via
Preferences > General > appearance > colors and fonts > basic > Content Assist
Comment 1 Angelo ZERR CLA 2016-01-28 05:26:04 EST
I have the same problem with JSDT Dark theme that I'm doing https://bugs.eclipse.org/bugs/show_bug.cgi?id=486341

It seems that org.eclipse.jface.fieldassist.ContentProposalAdapter and org.eclipse.jface.text.contentassist.ContentAssistant which uses Table to display completion items cannot be customized for background/foreground color.

SWT Table doesn't provide a method liek Table#setSelectionBackround, but we can emulate like this:

------------------------------------
final Table table = proposalTable;
final Color blue = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
table.addListener(SWT.EraseItem, new Listener() {
    @Override
    public void handleEvent(Event event) {
        event.detail &= ~SWT.HOT;
        if ((event.detail & SWT.SELECTED) == 0)
            return; /* item not selected */
        int clientWidth = table.getClientArea().width;
        GC gc = event.gc;
        Color oldForeground = gc.getForeground();
        Color oldBackground = gc.getBackground();
        //gc.setForeground(blue);
        gc.setBackground(blue);
        gc.fillRectangle(0, event.y, clientWidth, event.height);
        gc.setForeground(oldForeground);
        gc.setBackground(oldBackground);
        event.detail &= ~SWT.SELECTED;
    }
});
------------------------------------

It should be very cool if that org.eclipse.jface.fieldassist.ContentProposalAdapter and org.eclipse.jface.text.contentassist.ContentAssistant could provide this feature and Eclispe IDE could style it. 

IMHO I think dark theme is very important today and we could fix dark theme for completion selection background for the whole dark theme of any editors (JDT, JSDT, etc).
Comment 2 Michael Schmidt CLA 2016-03-20 11:48:50 EDT
Same problem here on Windows 7 when using Windows' Classic Theme. Works on Aero-Theme.

So the problem is related to the colors used by the OS.
Comment 3 ja GeniuZ CLA 2018-05-04 10:41:34 EDT
Created attachment 273932 [details]
selected no focused line in list is unreadable
Comment 4 ja GeniuZ CLA 2018-05-04 10:42:38 EDT
Same problem here. There is not possible change background color of "no focused selected item" in lists. I didn't find where the color is obtained, on my system this color is #F2F2F2. Problem is not only with content assist, but also with other same types of lists, for example in Preferences:

General->Editors->File Associations->File Types
Java->Build Path->Classpath Variables->Defined classpath variables
etc.

If you select item in this lists and move focus out of list, background color is changed to no editable color.

Please take note, if focus it gained to list, selected line background is changed to dark color and text is readable.
Comment 5 Grégory OLIVER CLA 2019-09-13 07:22:55 EDT
Same problem on Windows 7 when using Windows' Classic Theme. 
And also on Windows 7 when using aero theme. but in aero-theme, it's more readable. see attachement
Comment 6 Grégory OLIVER CLA 2019-09-13 07:23:42 EDT
Created attachment 279856 [details]
Content assist classic theme
Comment 7 Grégory OLIVER CLA 2019-09-13 07:24:10 EDT
Created attachment 279857 [details]
content assist on aero
Comment 8 Grégory OLIVER CLA 2019-09-13 07:28:28 EDT
(In reply to Grégory OLIVER from comment #5)
> Same problem on Windows 7 when using Windows' Classic Theme. 
> And also on Windows 7 when using aero theme. but in aero-theme, it's more
> readable. see attachement

Eclipse version :
Version: 2019-06 (4.12.0)
Build id: 20190614-1200
Comment 9 Lars Vogel CLA 2019-09-13 07:32:24 EDT
(In reply to Grégory OLIVER from comment #8)
> (In reply to Grégory OLIVER from comment #5)
> > Same problem on Windows 7 when using Windows' Classic Theme. 
> > And also on Windows 7 when using aero theme. but in aero-theme, it's more
> > readable. see attachement
> 
> Eclipse version :
> Version: 2019-06 (4.12.0)
> Build id: 20190614-1200

Did you try with the Eclipse Dark Theme?