Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320145 - GTK Combo with a black foreground always uses a white foreground on the hovered list item
Summary: GTK Combo with a black foreground always uses a white foreground on the hover...
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-16 17:23 EDT by Heath Borders CLA
Modified: 2014-02-13 09:02 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heath Borders CLA 2010-07-16 17:23:58 EDT
Build Identifier: 

On GTK, when a Combo has a black foreground (either by explicitly setting the foreground to black, or by using the system default and setting the foreground to null)  and a non-white background and the Combo's list is visibile, the list item over which the user is hovering has its foreground set to white.

This is not consistent with the behavior of windows.

Reproducible: Always

Steps to Reproduce:
public class GtkComboHoverBackgroundBug {
	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell();
		shell.setLayout(new GridLayout());

		final Combo combo = new Combo(shell, SWT.READ_ONLY);
		combo.setBackground(new Color(display, new RGB(255, 255, 254)));
		combo.setForeground(new Color(display, new RGB(0, 0, 0)));
		combo.setItems(new String[] { "0", "1", "2", });
		combo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

		final Button button = new Button(shell, SWT.TOGGLE);
		button.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				if (button.getSelection()) {
					combo.setForeground(new Color(display, new RGB(0, 0, 1)));
					button.setText("Switch to black");
				} else {
					combo.setForeground(null);
					button.setText("Switch to non-black");
				}
				shell.layout(true, true);
			}
		});
		button.setText("Switch to non-black");
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}

		display.dispose();
	}
}
Comment 1 Alexander Kurtakov CLA 2013-12-20 05:20:20 EST
Can you attach a screenshot of the windows behaviour ? What do you think is the correct behavior?
Comment 2 Alexander Kurtakov CLA 2014-02-13 09:02:30 EST
More than a month without reply and it is unclear to me what is considered to be the right behaviour in this case. Closing.
Please reopen when you have time to help us improve.