Community
Participate
Working Groups
Created attachment 108913 [details] An image depicting the white background of the error message. I noticed its white background while checking out bug 242723. I'm sure I've seen it before but just never bothered to complain about it. Adding the code below to DialogMessageArea's createContents(Composite) method will fix the problem. messageText.setBackground(messageComposite.getBackground()); However, I don't get why it doesn't just recursively inherit the parent's background which seems to be what it's doing on Windows (according to bug 242723).
This is not a preference problem. It is a discrepancy between GTK+ and Windows. Running the below on GTK+ will show a white text box whereas on Windows, it is "greyed" out and properly inherits the background colour of the parent Composite. public class DemonstrateAppWindowTopSeparatorProblem { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Composite composite = new Composite(shell, SWT.NONE); composite.setLayout(new GridLayout()); Text messageText = new Text(composite, SWT.NONE); //messageText.setBackground(composite.getBackground()); messageText.setEditable(false); messageText.setText("ABC"); //$NON-NLS-1$ shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } If you uncomment the background code above (which I described in comment 0), it will work properly on GTK+. I don't know if that's what we want to do in DialogMessageArea though. Perhaps the proper solution would be to use a Label instead of a Text (as it is not editable anyway) instead of hacking in the setBackground(Color) call.
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Same problem exists on OSX.
I would like to fix this in context of the #greatfix initiative. I agree that the error message is not editable anyway, so using a label instead of a non-editable Text should work just fine, and would avoid the need for hacking the background colour, so that is the solution I'm trying to implement in jface.
New Gerrit change created: https://git.eclipse.org/r/46241
(In reply to Robert Roth from comment #4) > I agree that the error message is not editable anyway, so using a label > instead of a non-editable Text should work just fine, and would avoid the > need for hacking the background colour, so that is the solution I'm trying > to implement in jface. Just FYI: the reason for the text is probably the possibility to select & copy the error message *text*. With the label this will be not possible & screen readers support. In context of the preferences dialog this could be not that important, but the fix is for the public class org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogMessageArea.java and I guess changing this is similar to breaking the API, since many clients might have expected that the message area is a *Text* (as specified in the class javadoc) with that specific behavior. Also see comment on the review: the "Label" probably can't be used by screen readers.
OK then, changing to Label idea dismissed, would you agree with the "background hack"on the text widget, as suggested in the description ?
(In reply to Robert Roth from comment #7) > OK then, changing to Label idea dismissed, would you agree with the > "background hack"on the text widget, as suggested in the description ? The fact that it works under Windows but not Linux rather indicates an SWT problem rather than a bug in Platform UI.
This Bug is still present, has somebody created an SWT Ticket for it as suggested by comment 8? Or can it be moved over to the SWT Component?
Moving to SWT