GUI bckgnd changed when going from SWT 3.1.1-->3.2.1

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

GUI bckgnd changed when going from SWT 3.1.1-->3.2.1

Postby Slot Head » Wed Jan 24, 2007 5:59 pm

My development team has been using Eclipse 3.1.1. Recently, I convinced everyone we should upgrade to 3.2.1 and along with that, upgrade to latest SWT Designer. Among other things, this I knew would fix a bug related to handling keystrokes in custom SWT controls.

Much to our surprise, after changing our project to use the SWT/JFace libs associated with 3.2.1, we found that the background color on virtually every window and some, but not all composites and groups had changed from the standard gray to a very light shade of gray. On top of this were unaffected areas so our app went from a stock, neutral gray look (with default windows settings) to mismash of gray and white backgrounds that is visually confusing at best.

Previously we had consistently done nothing to set our background colors. Thus they were the default system color, SWT.WIDGET_BACKGROUND, if I'm not mistaken. To clarify, we simply did not set the background, there was no code anywhere setting the background, and we now find ourselves with an apparent mess to clean up.

I fully expect this is not an SWT-Designer issue, but am asking for help here because this group has always been way more knowledegable and supportive than any of the eclipse forums (not to mention that awful newsreader approach they insist on using, how we yearn for their forums to be like this one).

We don't want to retreat to the 3.1.1 libs. Can anyone offer any advice about what we should do? Edit every form we've created?

TIA
Slot Head
 
Posts: 36
Joined: Sun Jul 10, 2005 9:50 am

Re: GUI bckgnd changed when going from SWT 3.1.1-->3.2.1

Postby Eric Clayberg » Wed Jan 24, 2007 8:22 pm

Just to clarify, if you load the same project under Eclipse 3.1.1 and 3.2.1 on the same machine, you see different background colors? Or does this happen on different machines?

If your code does not specify a background color, you should be seeing the default background color defined by the OS. The problem here is that the background color defined by the OS can vary from machine to machine, from OS version to OS version, and from Windows theme to Windows theme.

If you are seeing this all happen on a single machine with a single OS version and single theme in place, this would be truly strange. I am not aware of any differences in how SWT handles the default Windows background color between 3.1.1 and 3.2.1.

Could you send us a small, standalone test case that we can run locally under both 3.1.1 and 3.2.1? Personally, I see exactly the same background color for both versions of Eclipse with all of the test cases that I have.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Slot Head » Thu Jan 25, 2007 10:57 am

Thank you Eric, for the help. I realize this is probably an Eclipse problem and nothing amiss about your product, so I really appreciate the support.

To answer your questions:
1. We updated two developer's PC's.
2. Both PC's were virtually identical. Previously they both had Eclipse 3.1.1 The SWT and JFace libs associated with 3.1.1 were in the build path of our project. Our app had the ordinary, default Windows gray look all over.
3. After updating to 3.2.1, we changed the build paths of our project on both PC's. We did this by examining what libs were used when you selected a new SWT/JFace project using the SWT Designer. I.e., the libs we used are the ones you get by default when starting a new project with Designer.

4. After this change, both apps had the background color of their windows appear as a very light shade of gray- almost white, but not quite. Groups and composites on top of those were typically still the same original gray. I observed that some composites or groups here and there that changed to the light color.

5. I noticed some new properties in the Designer that related to background color. Is there some documentation somewhere I can go read about these?

6. After seeing the color change, we were totally surprised. So naturally, we went and looked at the code. We did not find any statements setting the background. The code appeared to be exactly what we had before. We use SVN and can go do comparisons, but we don't think that will reveal anything.

Totally confused. We'll see about sending you a test case.
TIA for any suggestions
Slot Head
 
Posts: 36
Joined: Sun Jul 10, 2005 9:50 am

Postby Eric Clayberg » Thu Jan 25, 2007 11:09 am

If you re-install 3.1.1 on those same machines (so you have both 3.2.1 and 3.1.1 installed side by side), do these windows look different under the different versions of Eclipse.

I'm trying to eliminate some other external factor that might be affecting the Windows theme colors in place on either PC.

A test case would indeed be useful. All of the code I have looks identical under both of those Eclipse versions (not even a hint of difference in background colors).
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Slot Head » Thu Jan 25, 2007 6:45 pm

Hi Eric and thanks again for the help.

This is confirm that: yes, we have two PC's that have Eclipse 3.1.1 and 3.2.1 installed in parallel on them.

With both systems, when we open the project with Eclipse 3.1.1 it looks "normal." All of the GUI is the usual gray look.

With both systems when we open the project with Eclipse 3.2.1, all of the GUI has a white background.

If we go back and open with 3.1.1, it's the standard gray again.

In a way I'm glad this blows your mind because it sure does mine.

Bill
Slot Head
 
Posts: 36
Joined: Sun Jul 10, 2005 9:50 am

Postby Eric Clayberg » Thu Jan 25, 2007 7:57 pm

If you want to send us a test case, we can look at it under 3.1.1 and 3.2.1 as well.

You might also post the same example to the Eclipse SWT newsgroup.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Slot Head » Mon Jan 29, 2007 10:06 am

Eric and company, with 3.1.1 we had a background property. Now, if I'm not mistaken, I see a *new* property near it: backgroundMode.

This is new as of 3.2 or 3.2.1, I believe. I see mine set to inherit_none.

Could this be the cause of some unexpected changes in background color described in earlier messages in this thread???

Is there some kind of global, top of the tree setting for background color that my main window and all its descendants are inheriting?

Did you guys do anything special to implement this new property, or did it just sort of show up and you have nothing to do with it?

Also, your ResourceManager code that is generated by the Designer has always been a little mysterious to me. Why? Because it worked so well, I never had to go into to it to fix anything. But now I wonder if it is taking some kind of hit, transitioning from 3.1.1 to 3.2.1. Should I let Designer create a new project and then graft the ResourceManager code in from that? I see that all my icons have changed from their graphical form to big fat buttons with only text on them. That will probably mean something significant to you.

And given cascading style sheets with GWT, could be I am getting a little splashover from that world?

Thanks for the help
Slot Head
 
Posts: 36
Joined: Sun Jul 10, 2005 9:50 am

Postby Eric Clayberg » Mon Jan 29, 2007 11:28 am

Slot Head wrote:Eric and company, with 3.1.1 we had a background property. Now, if I'm not mistaken, I see a *new* property near it: backgroundMode.
This is new as of 3.2 or 3.2.1, I believe. I see mine set to inherit_none.

That would be the default and should give you the same behavior as in 3.1.1. The "inheret_default" option appears to cause child widgets to use the same background color as their parent. That is new behavior available in 3.2.

Slot Head wrote:Could this be the cause of some unexpected changes in background color described in earlier messages in this thread?

Unlikely, as long as you are using the default setting.

Slot Head wrote:Is there some kind of global, top of the tree setting for background color that my main window and all its descendants are inheriting?

Not that I am aware of.

Slot Head wrote:Did you guys do anything special to implement this new property, or did it just sort of show up and you have nothing to do with it?

We did nothing special. Designer automatically picks up new properties as they are introduced by SWT. This works with your own custom composites as well.

Slot Head wrote:Also, your ResourceManager code that is generated by the Designer has always been a little mysterious to me. Why? Because it worked so well, I never had to go into to it to fix anything. But now I wonder if it is taking some kind of hit, transitioning from 3.1.1 to 3.2.1. Should I let Designer create a new project and then graft the ResourceManager code in from that?

You can, but that won't have any effect. Designer will automatically update the code for the resource manager classes, if it is out of date.

Slot Head wrote:I see that all my icons have changed from their graphical form to big fat buttons with only text on them. That will probably mean something significant to you.

In Eclipse 3.1and before, buttons could contain either an icon or a text label. With Eclipse 3.2, buttons may now have icons and text. If your original code specified both an image and text in 3.1, you could certainly see different behavior in 3.2.

Slot Head wrote:And given cascading style sheets with GWT, could be I am getting a little splashover from that world?

I don't see how that would be possible.

If you are seeing this behavior at *runtime* (e.g., the same code actually runs differently), then it is an SWT issue of some sort. Personally, I have never seen this.

Did you try asking on the Eclipse SWT newsgroup?

If you want to send us a test case...
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests