Community
Participate
Working Groups
N20060206-0010 + org.eclipse.workbench from HEAD When trying out the patch in bug 124873 I noticed that the light bulb looks fat/ugly. I assume you copied the Platform Text image. This image uses color transparency and hence the decoration composite color shine through. You should either adapt the composite's background or try out the new Composite.setBackgroundMode(SWT.INHERIT_DEFAULT) API.
Good eye! The composite's color was being set to white by the client (the cell editor.) However this was done directly on the control, so the label containing the decoration was not updated. This actually exposed the need for new API DecoratedField.setBackgroundColor(Color color) Normally the default colors are appropriate, but if a client wants to use a non-default color for the field background, then you want to set it on the field so that all the related widgetry is updated. Fixed >20060206
Can you explain your fix a bit more. Couldn't you just use the proposed new API? I tried it out by setting it on the form and it worked as expected.
The decorators themselves are shown inside a Label control. The label's background is where the ugliness was coming from. Label doesn't support the new API.
OK, maybe the code changed inbetween. I've used setBackgroundMode(SWT.INHERIT_DEFAULT) on DecoratedField.form and it did the trick.
I'll be honest, I didn't try it since Label doesn't support the new API. I just assumed that setting it only on the composite would not be enough. It would be nice not to have new API introduced for this if the SWT does what I want, but I'll have to check it on all platforms...so reopening to check for M5 if possible.
I just came back to this one in order to remove the setBackground API on DecoratedField if it is not necessary. I removed the API and before even trying the Composite.setBackgroundMode API, I observe that the extra gray pixels are now gone. I saw the problem last week so I do know what I'm looking for. I cannot explain why it has now gone away. Tested on Win and Mac, and there are no extra gray/fuzzy parts on the light bulb when the background white. Moving this to M6 for further investigation on Linux and to ensure that it all looks okay after SWT stabilizes for M5. Also, the setBackgroundMode is still marked experimental although UI forms uses it.
note to self: see SWT bug #29994
Fixed I-20060301. I've just verified it on Win, Linux, and Mac. In M5, I used code that set the label's background color to the composite background when it was created. This "fixed" the problem as long as the decorated field color was set before any decorations were created, but would not keep the colors up to date afterward. Using the new SWT background mode support allows me to remove code that sets the label color, thus always inheriting the composite color. Marking this bug dependent on bug #29994 since that API is still marked "under construction." Verified that the bulb looks correct on Windows, Linux GTK, and Mac.
verified on I20060328-0010, win XP in patched new interface wizard. (note that this particular use case is not in M6, but is useful for verifying the bulb icon against a white background)