Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329573

Summary: ToolItem's text foreground colour becomes parent's background colour when depressed/clicked on
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, Silenio_Quarti
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Remy Suen CLA 2010-11-05 14:03:50 EDT
Please run the code below. When you click on the item, its text turns white! :O

-----------------

Display display = new Display();
Shell shell = new Shell (display);
shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
ToolBar bar = new ToolBar (shell, SWT.BORDER);
for (int i=0; i<2; i++) {
	ToolItem item = new ToolItem (bar, SWT.PUSH);
	item.setText ("Item " + i);
}
bar.pack();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
	if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
Comment 1 Felipe Heidrich CLA 2010-11-05 14:48:46 EDT
I tested on xp, vista, and 7. It only fails on XP.
Comment 2 Felipe Heidrich CLA 2010-11-05 15:09:18 EDT
Okay, please test again. 
a) set the background of the shell in your example to red, the item is still white when pressed
b) run control example, the toolitems are white when pressed
c) to windows explorer and press a toolitem (with text), the text goes white.

bottom: toolitems have white text color when pressed.

agreed ?
Comment 3 Felipe Heidrich CLA 2010-11-05 15:11:35 EDT
closing as wont fix. platform behaviour.